瀏覽代碼

Fixed file operation dialog callback error when parent is closed

tobychui 4 年之前
父節點
當前提交
e61793da57
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      web/SystemAO/file_system/file_operation.html

+ 9 - 2
web/SystemAO/file_system/file_operation.html

@@ -637,8 +637,15 @@ mainloop:
                             }else if (operationConfig.callbackWindowID !== undefined && operationConfig.callbackFunction !== undefined){
                                 var callbackWindowObject = parent.getFloatWindowByID(operationConfig.callbackWindowID)
                                 var windowObject = $(callbackWindowObject).find("iframe")[0];
-                                console.log(windowObject.contentWindow, operationConfig.callbackFunction);
-                                windowObject.contentWindow.eval(operationConfig.callbackFunction);
+                                if (windowObject == undefined || windowObject == null){
+                                    //Caller no longer exists.
+                                    
+                                }else{
+                                    //Caller still exists. Do callback events
+                                    //console.log(windowObject.contentWindow, operationConfig.callbackFunction);
+                                    windowObject.contentWindow.eval(operationConfig.callbackFunction);
+                                }
+                                
                             }
 
                             //If the target or src is desktop, refresh desktop as well