aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-06 14:36:43 -0400
committerGitHub <noreply@github.com>2020-09-06 14:36:43 -0400
commitb28241dbf23b627e252348aa0445e4e7befe01fc (patch)
tree7fe05589ccdc2a3e6fb1b8df0dfb4c85fb0a4bc9 /ext/mixed
parent44f38c4dea6d517bb7657063ed2394745945c1f8 (diff)
Fix error handling for screenshot captures (#777)
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/display.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index ce7a4385..4c058948 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -1049,9 +1049,11 @@ class Display extends EventDispatcher {
const details = {};
if (this._noteUsesScreenshot(mode)) {
- const screenshot = await this._getScreenshot();
- if (screenshot) {
+ try {
+ const screenshot = await this._getScreenshot();
details.screenshot = screenshot;
+ } catch (e) {
+ // NOP
}
}
@@ -1155,7 +1157,6 @@ class Display extends EventDispatcher {
const {format, quality} = this._options.anki.screenshot;
const dataUrl = await api.screenshotGet({format, quality});
- if (!dataUrl || dataUrl.error) { return; }
return {dataUrl, format};
} finally {