From b5c1db9ad9901585e397492888b6320b724298fe Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 21 Apr 2016 11:17:12 +0900 Subject: [PATCH] Guard against unexist owner when removing ref to remote object --- lib/browser/objects-registry.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/browser/objects-registry.js b/lib/browser/objects-registry.js index b8aa480a6dba..adbf6835554c 100644 --- a/lib/browser/objects-registry.js +++ b/lib/browser/objects-registry.js @@ -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.