mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Guard against focusing a destroyed pane
This commit is contained in:
@@ -751,6 +751,12 @@ describe "Pane", ->
|
||||
pane2.destroy()
|
||||
expect(container.root).toBe pane1
|
||||
|
||||
describe "::focus()", ->
|
||||
it "doesn't blow up if the pane has been destroyed", ->
|
||||
pane = new Pane(paneParams())
|
||||
pane.destroy()
|
||||
pane.focus()
|
||||
|
||||
describe "serialization", ->
|
||||
pane = null
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ class Pane extends Model
|
||||
# Called by the view layer to indicate that the pane has gained focus.
|
||||
focus: ->
|
||||
@focused = true
|
||||
@activate() unless @isActive()
|
||||
@activate() unless @isActive() or @isDestroyed()
|
||||
|
||||
# Called by the view layer to indicate that the pane has lost focus.
|
||||
blur: ->
|
||||
|
||||
Reference in New Issue
Block a user