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

Fatal Exception: java.lang.NullPointerException: Listener must not be null #55

Closed
bobymicroby opened this issue Nov 29, 2017 · 2 comments

Comments

@bobymicroby
Copy link

I think you have introduced this bug in 1.0.3

When you unsubscribe from LocationUpdatesFlowableOnSubscribe before onGoogleApiClientReady is called, there is no locationListener instance initialized and we got a NPE

@Override
    protected void onUnsubscribed(GoogleApiClient apiClient) {
        LocationServices.FusedLocationApi.removeLocationUpdates(apiClient,  *locationListener*);
        locationListener.onUnsubscribed();
        locationListener = null;
    }

Fatal Exception: java.lang.NullPointerException: Listener must not be null
at com.google.android.gms.common.internal.zzbq.checkNotNull(Unknown Source)
at com.google.android.gms.common.api.internal.zzcp.zzb(Unknown Source)
at com.google.android.gms.internal.zzcdh.zza(Unknown Source)
at com.google.android.gms.common.api.internal.zzm.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzao.zze(Unknown Source)
at com.google.android.gms.common.api.internal.zzbl.zze(Unknown Source)
at com.google.android.gms.common.api.internal.zzbd.zze(Unknown Source)
at com.google.android.gms.internal.zzccy.removeLocationUpdates(Unknown Source)
at com.patloew.rxlocation.LocationUpdatesFlowableOnSubscribe.onUnsubscribed(LocationUpdatesFlowableOnSubscribe.java:54)
at com.patloew.rxlocation.RxLocationFlowableOnSubscribe.lambda$subscribe$0(RxLocationFlowableOnSubscribe.java:58)
at com.patloew.rxlocation.RxLocationFlowableOnSubscribe$$Lambda$1.cancel(Unknown Source)
at io.reactivex.internal.disposables.CancellableDisposable.dispose(CancellableDisposable.java:49)

@kurtisnelson
Copy link

+1, I am seeing this on my emulators missing play services now that I added a timeout.

patloew added a commit that referenced this issue Jun 9, 2018
patloew added a commit that referenced this issue Jun 9, 2018
@patloew
Copy link
Owner

patloew commented Jun 9, 2018

Fixed in v1.0.5.

@patloew patloew closed this as completed Jun 9, 2018
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

3 participants