aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-04-29 14:30:31 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-04-29 14:30:31 +0200
commit44e3a77abeee00d5b1d95535062e0cce9c5d7cfc (patch)
tree43483c5c755df7b689c5c4f1f8e3ade393e4403f
parentui: force tray and mtw to appear (diff)
downloadwireguard-windows-44e3a77abeee00d5b1d95535062e0cce9c5d7cfc.tar.xz
wireguard-windows-44e3a77abeee00d5b1d95535062e0cce9c5d7cfc.zip
ui: account for IPC failures in UI initialization
-rw-r--r--ui/managewindow.go8
-rw-r--r--ui/tunnelspage.go6
2 files changed, 11 insertions, 3 deletions
diff --git a/ui/managewindow.go b/ui/managewindow.go
index 4046d6db..626b5efb 100644
--- a/ui/managewindow.go
+++ b/ui/managewindow.go
@@ -63,10 +63,14 @@ func NewManageTunnelsWindow() (*ManageTunnelsWindow, error) {
mtw.tabs, _ = walk.NewTabWidget(mtw)
- mtw.tunnelsPage, _ = NewTunnelsPage()
+ if mtw.tunnelsPage, err = NewTunnelsPage(); err != nil {
+ return nil, err
+ }
mtw.tabs.Pages().Add(mtw.tunnelsPage.TabPage)
- mtw.logPage, _ = NewLogPage()
+ if mtw.logPage, err = NewLogPage(); err != nil {
+ return nil, err
+ }
mtw.tabs.Pages().Add(mtw.logPage.TabPage)
disposables.Spare()
diff --git a/ui/tunnelspage.go b/ui/tunnelspage.go
index 86ab1235..469ecdeb 100644
--- a/ui/tunnelspage.go
+++ b/ui/tunnelspage.go
@@ -44,7 +44,11 @@ func NewTunnelsPage() (*TunnelsPage, error) {
tunnelsContainer, _ := walk.NewComposite(tp)
tunnelsContainer.SetLayout(walk.NewVBoxLayout())
- tp.tunnelsView, _ = NewTunnelsView(tunnelsContainer)
+ //TODO: deal with remaining disposables in case the next line fails
+
+ if tp.tunnelsView, err = NewTunnelsView(tunnelsContainer); err != nil {
+ return nil, err
+ }
tp.tunnelsView.ItemActivated().Attach(tp.onTunnelsViewItemActivated)
tp.tunnelsView.CurrentIndexChanged().Attach(tp.updateConfView)