From 26b2c300b88bd1a1608eb436f1c3e02833dcb062 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Fri, 23 Aug 2024 10:27:08 +0200 Subject: [PATCH] fix: fixed a nil pointer dereference when wifi.show is executed before wifi.recon on --- modules/wifi/wifi_show.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/wifi/wifi_show.go b/modules/wifi/wifi_show.go index 9a55a293..7697df73 100644 --- a/modules/wifi/wifi_show.go +++ b/modules/wifi/wifi_show.go @@ -315,6 +315,13 @@ func (mod *WiFiModule) showStatusBar() { } func (mod *WiFiModule) Show() (err error) { + // module has not been started yet + if mod.iface == nil { + if err := mod.Configure(); err != nil { + return err + } + } + var stations []*network.Station if err, stations = mod.doSelection(); err != nil { return