File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,14 @@ public Subscription subscribe(Observer<T> observer) {
157
157
// the subscribe function can also be overridden but generally that's not the appropriate approach so I won't mention that in the exception
158
158
}
159
159
if (isTrusted ) {
160
- return onSubscribe .call (observer );
160
+ Subscription s = onSubscribe .call (observer );
161
+ if (s == null ) {
162
+ // this generally shouldn't be the case on a 'trusted' onSubscribe but in case it happens
163
+ // we want to gracefully handle it the same as AtomicObservableSubscription does
164
+ return Subscriptions .empty ();
165
+ } else {
166
+ return s ;
167
+ }
161
168
} else {
162
169
AtomicObservableSubscription subscription = new AtomicObservableSubscription ();
163
170
return subscription .wrap (onSubscribe .call (new AtomicObserver <T >(subscription , observer )));
You can’t perform that action at this time.
0 commit comments