Patch for 1.4.5 to deal with a null contentWindow while resizing.

30 views
Skip to first unread message

Anthony van Orizande

unread,
Jun 3, 2017, 9:43:20 AM6/3/17
to cleditor
The following is a small patch to cleditor to deal with a bug that can appear when resizing a main application window that contains a cleditor.

In the function refresh(editor), the contentWindow can sometimes return as NULL which results in an error and breaks the rest of the UI.

My patch is below.

Thank you very much for a nice light editor.

Anthony

jquery.cleditor-1.4.5.x.js


@@ -845,7 +845,10 @@
             .appendTo($main);
 
         // Load the iframe document content
-        var contentWindow = $frame[0].contentWindow,
+        var contentWindow = $frame[0].contentWindow;
+        if (!contentWindow)
+            return;
+        var
           doc = editor.doc = contentWindow.document,
           $doc = $(doc);
 

Reply all
Reply to author
Forward
0 new messages