-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Description
ServiceFuture.fromBody(Completable, ServiceCallback) does not assign value to subscription class variable.
https://github.com/Azure/autorest-clientruntime-for-java/blob/master/client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java#L129-L150
Then ServiceFuture.cancel() calls subscription.unsubscribe() which produces NullPointerException, as subscription is null.
The correct code should be serviceFuture.subscription = completable.subscribe(...
Temporary workaround, avoid calling ServiceFuture.fromBody(Completable, ServiceCallback). Use other factory method e.g. ServiceFuture.fromBody(Observable, ServiceCallback).