From 9ba2d11cd5148caea99747b977827b9400a7058d Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 17 Apr 2020 16:50:41 +0200 Subject: [PATCH] Guard against a type error --- www/code/markers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/code/markers.js b/www/code/markers.js index 9ce7de56a..5fd6fe068 100644 --- a/www/code/markers.js +++ b/www/code/markers.js @@ -478,7 +478,7 @@ define([ // Remove marks that are placed under this one try { Env.editor.findMarks(from, to).forEach(function (mark) { - if (mark.attributes['data-type'] !== 'authormark') { return; } + if (!mark || !mark.attributes || mark.attributes['data-type'] !== 'authormark') { return; } mark.clear(); }); } catch (e) {