aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-04-09 11:36:52 -0700
committerAlex Yatskov <alex@foosoft.net>2017-04-09 11:36:52 -0700
commit957c283d8a694567d3f2dc9033a4edd7988dd09b (patch)
tree2b627029f1fdd5cadb8ba2f4f5c787087e28bcfa
parentcb5f725db744c73247ede582beb48d7cd0494aab (diff)
fix #44, fix #45
-rw-r--r--ext/mixed/js/display.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 64d462ae..0167c605 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -74,7 +74,10 @@ class Display {
if (context) {
for (const definition of definitions) {
- definition.cloze = clozeBuild(context.sentence, definition.source);
+ if (context.sentence) {
+ definition.cloze = clozeBuild(context.sentence, definition.source);
+ }
+
definition.url = context.url;
}
}
@@ -108,7 +111,10 @@ class Display {
if (context) {
for (const definition of definitions) {
- definition.cloze = clozeBuild(context.sentence);
+ if (context.sentence) {
+ definition.cloze = clozeBuild(context.sentence);
+ }
+
definition.url = context.url;
}
}