summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/codeq/hint.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/codeq/hint.js b/js/codeq/hint.js
index e77a3dc..0242443 100644
--- a/js/codeq/hint.js
+++ b/js/codeq/hint.js
@@ -180,6 +180,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
typeHandlers = {
'static': function (template, hint, box) {
+ if (!template) return;
var content = prepareStaticHintContent(template, hint.indices, hint.id),
args = hint ? hint.args : null,
hintIndex = 0,
@@ -251,11 +252,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
codeq.log.debug('Processing popup hint');
var args = hint.args,
style = hint.style || '',
- mark = addMark(hint.start, hint.end, style), // add the mark
langs = codeq.availableLangs,
translations = {},
lang, i, content, htmlPrefix, instFunc;
+ // highlight given range in the editor
+ var mark = addMark(hint.start, hint.end, style);
+ if (!template) return;
+
// execute templates for all languages
for (i = langs.length - 1; i >= 0; i--) {
lang = langs[i];
@@ -337,10 +341,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
continue;
}
hintContent = hintProblemTr[hint.id] || hintCommonTr[hint.id];
- if (!hintContent) {
- codeq.log.error('Hint without content: ' + hint.id);
- continue;
- }
t = typeof hintDef;
if (t === 'string') hintType = hintDef; // currently a hint type is a string