summaryrefslogtreecommitdiffstats
path: root/tui/background.go
diff options
context:
space:
mode:
authorDaniel Milde <daniel@milde.cz>2024-04-01 18:01:43 +0200
committerDaniel Milde <daniel@milde.cz>2024-04-10 17:39:58 +0200
commit5c3e3912e049e2883be2c06bdb1fd4b01973d618 (patch)
treef4b7e9678cc0ee37e4553aab9376cc81e4c13171 /tui/background.go
parent16009ceb16298f37f948f0d44bae8b8bc3d66afb (diff)
fix: handle panics in delete workers
Diffstat (limited to 'tui/background.go')
-rw-r--r--tui/background.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tui/background.go b/tui/background.go
index c62d005..8f32c1a 100644
--- a/tui/background.go
+++ b/tui/background.go
@@ -17,6 +17,13 @@ func (ui *UI) queueForDeletion(items []fs.Item, shouldEmpty bool) {
}
func (ui *UI) deleteWorker() {
+ defer func() {
+ if r := recover(); r != nil {
+ ui.app.Stop()
+ panic(r)
+ }
+ }()
+
for item := range ui.deleteQueue {
ui.deleteItem(item.item, item.shouldEmpty)
}