mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Correctly handle Item#insertChild(null)
This commit is contained in:
parent
a307bc4d14
commit
16105067bf
1 changed files with 1 additions and 1 deletions
|
@ -2106,7 +2106,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
* possible.
|
||||
*/
|
||||
insertChild: function(index, item, _preserve) {
|
||||
var res = this.insertChildren(index, [item], _preserve);
|
||||
var res = item ? this.insertChildren(index, [item], _preserve) : null;
|
||||
return res && res[0];
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue