Skip to content

Commit 6102198

Browse files
committed
add null check for avoid npe
1 parent 042ad95 commit 6102198

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/io/reactivex/internal/schedulers/NewThreadWorker.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ public ScheduledRunnable scheduleActual(final Runnable run, long delayTime, Time
127127
}
128128
sr.setFuture(f);
129129
} catch (RejectedExecutionException ex) {
130-
parent.remove(sr);
130+
if (parent != null) {
131+
parent.remove(sr);
132+
}
131133
RxJavaPlugins.onError(ex);
132134
}
133135

0 commit comments

Comments
 (0)