summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}
}