mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Item#setName: Check for Item#_parent to avoid errors in removed items and top level groups. Fixes #76
This commit is contained in:
parent
55a795c285
commit
a343724094
1 changed files with 1 additions and 1 deletions
|
@ -209,7 +209,7 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
|
|||
if (this._name)
|
||||
this._removeFromNamed();
|
||||
this._name = name || undefined;
|
||||
if (name) {
|
||||
if (name && this._parent) {
|
||||
var children = this._parent._children,
|
||||
namedChildren = this._parent._namedChildren;
|
||||
(namedChildren[name] = namedChildren[name] || []).push(this);
|
||||
|
|
Loading…
Reference in a new issue