Guard against unexist owner when removing ref to remote object
authorCheng Zhao <zcbenz@gmail.com>
Thu, 21 Apr 2016 02:17:12 +0000 (11:17 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 21 Apr 2016 02:23:20 +0000 (11:23 +0900)
lib/browser/objects-registry.js

index b8aa480..adbf683 100644 (file)
@@ -50,7 +50,10 @@ class ObjectsRegistry {
     this.dereference(id)
 
     // Also remove the reference in owner.
-    this.owners[webContentsId].delete(id)
+    let owner = this.owners[webContentsId]
+    if (owner) {
+      owner.delete(id)
+    }
   }
 
   // Clear all references to objects refrenced by the WebContents.