Skip to content

Commit

Permalink
🎨: avoid crash of text render if cursor not present
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman committed Feb 17, 2023
1 parent 2594d06 commit c31b3d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lively.morphic/rendering/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,7 @@ export default class Renderer {
* @param {Text} morph
*/
removeTextSpecialsFromDOMFor (node, morph) {
const cursorNode = node.querySelector('.newtext-cursor');
cursorNode.remove();
node.querySelector('.newtext-cursor')?.remove();

const selectionNodes = node.querySelectorAll('.selection');
selectionNodes.forEach(n => n?.remove());
Expand Down

0 comments on commit c31b3d7

Please sign in to comment.