Skip to content

Commit

Permalink
Fix closed console crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristalev committed Oct 9, 2022
1 parent 4880bd2 commit 63b1920
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Nimble/Sources/Controls/ConsoleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ class ConsoleView: NSViewController, WorkbenchViewController {
return
}
consolesStorage.removeValue(forKey: console.title)
consoleSelectionButton.removeItem(withTitle: console.title)
let index = consoleSelectionButton.indexOfItem(withTitle: console.title)
if index > 0 {
consoleSelectionButton.removeItem(at: index)
}
console.stopReadingFromBuffer()
}

Expand Down

0 comments on commit 63b1920

Please sign in to comment.