Fixed crash when disabling wifi.