Guard against a type error

This commit is contained in:
yflory 2020-04-17 16:50:41 +02:00
parent d27dc768f3
commit 9ba2d11cd5

View File

@ -478,7 +478,7 @@ define([
// Remove marks that are placed under this one // Remove marks that are placed under this one
try { try {
Env.editor.findMarks(from, to).forEach(function (mark) { 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(); mark.clear();
}); });
} catch (e) { } catch (e) {