Skip to content

Commit

Permalink
fix: Fix panic if initial connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Sep 6, 2023
1 parent 763af6b commit d339398
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/device/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ func (d *Device) Close() error {
}

if d.app != nil {
defer func() {
if r := recover(); r != nil {
d.logger.Debug("Panic during close", "error", r, "stack", debug.Stack())
}
}()

return d.app.Close(false)
}

Expand Down

0 comments on commit d339398

Please sign in to comment.