Skip to content

Commit a588c66

Browse files
vanniktechakarnokd
authored andcommitted
2.x: PublishSubject enhance NPE when onNext(null) is called (#4531)
1 parent ebec0b2 commit a588c66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/io/reactivex/subjects/PublishSubject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void onNext(T t) {
176176
return;
177177
}
178178
if (t == null) {
179-
onError(new NullPointerException());
179+
onError(new NullPointerException("Subject got a null value. Null values are generally not allowed in 2.x operators and sources."));
180180
return;
181181
}
182182
for (PublishDisposable<T> s : subscribers.get()) {

0 commit comments

Comments
 (0)