I'm not suggesting catching any exceptions. If you update the atom to either return false when the wifi manager is undefined, or to wait for the wifi manager to be defined, then you don't have to ignore any exceptions.