Throw "Encoded image is null" instead of "Encoded image is not valid" when image is not provided
@@ -197,10 +197,15 @@ public class DecodeProducer implements Producer<CloseableReference<CloseableImag
FrescoSystrace.beginSection("DecodeProducer#onNewResultImpl");
}
final boolean isLast = isLast(status);
- if (isLast && !EncodedImage.isValid(newResult)) {
+ if (isLast) {
+ if (newResult == null) {
+ handleError(new ExceptionWithNoStacktrace("Encoded image is null."));
+ return;
+ } else if (!newResult.isValid()) {
handleError(new ExceptionWithNoStacktrace("Encoded image is not valid."));
return;
}
+ }
if (!updateDecodeJob(newResult, status)) {
return;
}
