aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-09-13 11:39:47 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2019-09-13 12:07:36 -0400
commit011b33d1dad3e0fa42ccdc65c3e96d22d30228c8 (patch)
tree6ba7e50a978e9c5956c48d32ea262d501380633b /ui
parentui: fix popup menu placement in syntaxedit (diff)
downloadwireguard-windows-011b33d1dad3e0fa42ccdc65c3e96d22d30228c8.tar.xz
wireguard-windows-011b33d1dad3e0fa42ccdc65c3e96d22d30228c8.zip
ui: do not use tray object when nil
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.go10
1 files 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 {