From 38e7eadf69aeb647836d84401316114b35627834 Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Mon, 26 Sep 2016 17:33:30 +0800 Subject: [PATCH] add temp guard code to detect potential prefab bug --- cocos2d/core/assets/CCPrefab.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/assets/CCPrefab.js b/cocos2d/core/assets/CCPrefab.js index a7a515fc39..453aa6722a 100644 --- a/cocos2d/core/assets/CCPrefab.js +++ b/cocos2d/core/assets/CCPrefab.js @@ -55,10 +55,14 @@ var Prefab = cc.Class({ }, _instantiate: function () { - //if (this.data._prefab) { + if (this.data._prefab) { // prefab asset is always synced this.data._prefab._synced = true; - //} + } + else { + // temp guard code + cc.warn('internal error: _prefab is undefined'); + } // instantiate var node = cc.instantiate(this.data);