Skip to content

Commit d65eae4

Browse files
aforciermaxme
authored andcommitted
Don't attempt to remove image selection formatting if the image is no longer attached to the document
1 parent 3c63db4 commit d65eae4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libs/editor/libs/editor-common/assets/ZSSRichTextEditor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,6 +1963,11 @@ ZSSEditor.applyImageSelectionFormatting = function( imageNode ) {
19631963
}
19641964

19651965
ZSSEditor.removeImageSelectionFormatting = function( imageNode ) {
1966+
if (!$('#zss_field_content')[0].contains(imageNode)) {
1967+
// The image node has already been removed from the document
1968+
return;
1969+
}
1970+
19661971
var node = ZSSEditor.findImageCaptionNode( imageNode );
19671972
if ( !node.parentNode || node.parentNode.className.indexOf( "edit-container" ) == -1 ) {
19681973
return;

0 commit comments

Comments
 (0)