[FIX] web_editor: prevent crash when dropping snippets
For some unknown reasons, the editor sometimes crashes when dropping a snippet. As a temporary fix, the non-critical line that causes the problem is try/catch protected by this commit.
This commit is contained in:
@@ -280,7 +280,15 @@ var RTE = Widget.extend({
|
||||
} else {
|
||||
rng = $editable.data('range') || rng;
|
||||
}
|
||||
rng.select();
|
||||
try {
|
||||
// TODO this line might break for unknown reasons. I suppose that
|
||||
// the created range is an invalid one. As it might be tricky to
|
||||
// adapt that line and that it is not a critical one, temporary fix
|
||||
// is to ignore the errors that this generates.
|
||||
rng.select();
|
||||
} catch (e) {
|
||||
console.log('error', e);
|
||||
}
|
||||
history.recordUndo($editable, event, internal_history);
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user