Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to invoke virtual method isRoaming() on a null object reference #560

Closed
ale5000-git opened this issue Jun 17, 2018 · 1 comment
Closed

Comments

@ale5000-git
Copy link
Member

ale5000-git commented Jun 17, 2018

I get this at boot:

[ 06-17 21:30:50.251  3264: 3598 W/GmsGcmMcsSvc ]
Exception while connecting!
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isRoaming()' on a null object reference
	at org.microg.gms.gcm.GcmPrefs.getNetworkPrefForInfo(GcmPrefs.java:103)
	at org.microg.gms.gcm.McsService.connect(McsService.java:370)
	at org.microg.gms.gcm.McsService.handleMessage(McsService.java:535)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:154)
	at org.microg.gms.gcm.McsService$HandlerThread.run(McsService.java:152)

[ 06-17 21:30:50.251  3264: 3598 D/GmsGcmMcsSvc ]
Teardown initiated, reason: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isRoaming()' on a null object reference

The problem is here but it is caused by the fact that there isn't a null check for the two call of cm.getActiveNetworkInfo() here.

ConnectivityManager.getActiveNetworkInfo():
a NetworkInfo object for the current default network or **null** if no default network is currently active.

@ale5000-git
Copy link
Member Author

Fixed in 7bbdcac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant