From f4f0c5044427d2fd05994618d758bce856c4aa22 Mon Sep 17 00:00:00 2001 From: riccardom Date: Sun, 2 Oct 2011 08:12:35 +0000 Subject: [PATCH] wifi: Don't dereference null pointer This probably is not hit in practice but better safe than sorry. Reported by cppcheck. --- desmume/src/wifi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp index 1203df4ed..a18f441cf 100644 --- a/desmume/src/wifi.cpp +++ b/desmume/src/wifi.cpp @@ -678,7 +678,7 @@ void WIFI_Reset() wifiCom = wifiComs[CommonSettings.wifi.mode]; if (wifiCom && (wifi_lastmode != CommonSettings.wifi.mode)) wifiCom->Init(); - else + else if (wifiCom) wifiCom->Reset(); wifi_lastmode = CommonSettings.wifi.mode;