Merge pull request #107 from VisualSJ/bug

场景数据错误造成的bug
This commit is contained in:
Jare Guo
2015-12-22 16:03:55 +08:00
+6 -1
View File
@@ -467,7 +467,12 @@ var Node = cc.Class({
if (! (component instanceof cc.Component) && CC_EDITOR) {
cc.error('Sorry, the component of entity "%s" which with an index of %s is corrupted! It has been removed.\nSee DevTools for details.', this.name, c);
console.log('Corrupted component value:', component);
this._removeComponent(component);
if (component) {
this._removeComponent(component);
}
else {
this._components.splice(c, 1);
}
--c;
--originCount;
}