mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
Throw 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