Fixed NPE when connecting to wireless AP.