From 8d9e7458af575e530d8688f065e2de8945d6719a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 13 Sep 2019 11:39:47 -0400 Subject: ui: do not use tray object when nil Signed-off-by: Jason A. Donenfeld --- ui/ui.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/ui.go b/ui/ui.go index 49e90007..42b351e8 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -73,7 +73,9 @@ func RunUI() { switch updateState { case manager.UpdateStateFoundUpdate: mtw.UpdateFound() - tray.UpdateFound() + if tray != nil { + tray.UpdateFound() + } case manager.UpdateStateUpdatesDisabledUnofficialBuild: mtw.SetTitle(mtw.Title() + " (unsigned build, no updates)") } @@ -87,12 +89,14 @@ func RunUI() { } }() - if noTrayAvailable { + if tray == nil { win.ShowWindow(mtw.Handle(), win.SW_MINIMIZE) } mtw.Run() - tray.Dispose() + if tray != nil { + tray.Dispose() + } mtw.Dispose() if shouldQuitManagerWhenExiting { -- cgit v1.2.3-59-g8ed1b