mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Merge pull request #7633 from atom/ns-pane-items-must-be-objects
Throw an exception when adding a non-object pane item
This commit is contained in:
@@ -336,6 +336,8 @@ class Pane extends Model
|
||||
#
|
||||
# Returns the added item.
|
||||
addItem: (item, index=@getActiveItemIndex() + 1) ->
|
||||
throw new Error("Pane items must be objects. Attempted to add item #{item}.") unless item? and typeof item is 'object'
|
||||
|
||||
return if item in @items
|
||||
|
||||
if typeof item.onDidDestroy is 'function'
|
||||
|
||||
Reference in New Issue
Block a user