From 9dbbb97fb986eec416088fddf24ee945d7b5b5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E7=BE=BD?= Date: Wed, 17 Oct 2018 15:57:07 +0800 Subject: [PATCH] Update module-collection.js Function `parent.getChild(key)` could return `undefined` --- src/module/module-collection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/module-collection.js b/src/module/module-collection.js index a68f05a51..30bc97522 100644 --- a/src/module/module-collection.js +++ b/src/module/module-collection.js @@ -49,7 +49,7 @@ export default class ModuleCollection { unregister (path) { const parent = this.get(path.slice(0, -1)) const key = path[path.length - 1] - if (!parent.getChild(key).runtime) return + if (!parent.getChild(key) || !parent.getChild(key).runtime) return parent.removeChild(key) }