aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit8d9e7458af575e530d8688f065e2de8945d6719a (patch)
tree6ba7e50a978e9c5956c48d32ea262d501380633b
parentui: fix popup menu placement in syntaxedit (diff)
downloadwireguard-windows-8d9e7458af575e530d8688f065e2de8945d6719a.tar.xz
wireguard-windows-8d9e7458af575e530d8688f065e2de8945d6719a.zip
ui: do not use tray object when nil
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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 {