added panic catch for gui

This commit is contained in:
0xdcarns
2022-05-06 10:54:48 -04:00
parent 59847f4522
commit 0937f416ba

View File

@@ -22,6 +22,11 @@ var logoContent embed.FS
// Run - run's the netclient GUI
func Run(networks []string) error {
defer func() {
if r := recover(); r != nil {
logger.Log(0, "No monitor detected, please use CLI commands; use -help for more info.")
}
}()
a := app.New()
window := a.NewWindow("Netclient - " + ncutils.Version)
@@ -100,11 +105,7 @@ func Run(networks []string) error {
views.CurrentContent.Add(views.GetView(views.Join))
window.SetContent(views.CurrentContent)
defer func() {
if r := recover(); r != nil {
logger.Log(0, "No monitor detected, please use CLI commands; use -help for more info.")
}
}()
window.ShowAndRun()
return nil
}