diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index ee522b39c795a7..449527de2ee611 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1549,6 +1549,14 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi std::unique_ptr ssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "SSID")); std::unique_ptr bssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "BSSID")); + // Network scan is performed in the background, so the BSS + // may be gone when we try to get the properties. + if (ssid == nullptr || bssid == nullptr) + { + ChipLogDetail(DeviceLayer, "wpa_supplicant: BSS not found: %s", bssPath); + return false; + } + const guchar * ssidStr = nullptr; const guchar * bssidBuf = nullptr; char bssidStr[2 * 6 + 5 + 1] = { 0 }; diff --git a/src/platform/webos/ConnectivityManagerImpl.cpp b/src/platform/webos/ConnectivityManagerImpl.cpp index ed43cd38f7d710..627fa14366ce1f 100644 --- a/src/platform/webos/ConnectivityManagerImpl.cpp +++ b/src/platform/webos/ConnectivityManagerImpl.cpp @@ -1518,6 +1518,14 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi std::unique_ptr ssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "SSID")); std::unique_ptr bssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "BSSID")); + // Network scan is performed in the background, so the BSS + // may be gone when we try to get the properties. + if (ssid == nullptr || bssid == nullptr) + { + ChipLogDetail(DeviceLayer, "wpa_supplicant: BSS not found: %s", bssPath); + return false; + } + const guchar * ssidStr = nullptr; const guchar * bssidBuf = nullptr; char bssidStr[2 * 6 + 5 + 1] = { 0 };