Quellcode durchsuchen

Fixed file operation dialog callback error when parent is closed

tobychui vor 4 Jahren
Ursprung
Commit
e61793da57
1 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
  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