Skip to content

Commit

Permalink
Change error message in ObservableFromArray (#6461)
Browse files Browse the repository at this point in the history
* Change error message in ObservableFromArray

Changed error message from "The $i th element is null" to "The element at index $i is null".

Solves #6460

* Change error messages in FlowableFromArray

Changed error messages from "array element is null" to "The element at index $i is null".

Solves #6460
  • Loading branch information
iruizm authored and akarnokd committed Apr 13, 2019
1 parent c04cfb8 commit deeb141
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void fastPath() {
}
T t = arr[i];
if (t == null) {
a.onError(new NullPointerException("array element is null"));
a.onError(new NullPointerException("The element at index " + i + " is null"));
return;
} else {
a.onNext(t);
Expand Down Expand Up @@ -156,7 +156,7 @@ void slowPath(long r) {
T t = arr[i];

if (t == null) {
a.onError(new NullPointerException("array element is null"));
a.onError(new NullPointerException("The element at index " + i + " is null"));
return;
} else {
a.onNext(t);
Expand Down Expand Up @@ -209,7 +209,7 @@ void fastPath() {
}
T t = arr[i];
if (t == null) {
a.onError(new NullPointerException("array element is null"));
a.onError(new NullPointerException("The element at index " + i + " is null"));
return;
} else {
a.tryOnNext(t);
Expand Down Expand Up @@ -239,7 +239,7 @@ void slowPath(long r) {
T t = arr[i];

if (t == null) {
a.onError(new NullPointerException("array element is null"));
a.onError(new NullPointerException("The element at index " + i + " is null"));
return;
} else {
if (a.tryOnNext(t)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void run() {
for (int i = 0; i < n && !isDisposed(); i++) {
T value = a[i];
if (value == null) {
downstream.onError(new NullPointerException("The " + i + "th element is null"));
downstream.onError(new NullPointerException("The element at index " + i + " is null"));
return;
}
downstream.onNext(value);
Expand Down

0 comments on commit deeb141

Please sign in to comment.