diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index e2044e11c8712c..436d58a168a88b 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1346,6 +1346,11 @@ CHIP_ERROR ConnectivityManagerImpl::GetConfiguredNetwork(NetworkCommissioning::N std::lock_guard lock(mWpaSupplicantMutex); std::unique_ptr err; + if (mWpaSupplicant.iface == nullptr) { + ChipLogDetail(DeviceLayer, "Wifi network not currently connected"); + return CHIP_ERROR_INCORRECT_STATE; + } + const gchar * networkPath = wpa_fi_w1_wpa_supplicant1_interface_get_current_network(mWpaSupplicant.iface); // wpa_supplicant DBus API: if network path of current network is "/", means no networks is currently selected.