Following my previous comment, here we test `if (interfacesReady)` before trying to get the wifi interface. If not, an alert could be shown to the user.