Bug 1300484 - IconResponse: Throw if bitmap is null. r?ahunt
This will crash later anyways but throwing here will allow us to identify code
that creates a response with a null bitmap (This shouldn't happen).
MozReview-Commit-ID: LJMSsW51eXo
--- a/mobile/android/base/java/org/mozilla/gecko/icons/IconResponse.java
+++ b/mobile/android/base/java/org/mozilla/gecko/icons/IconResponse.java
@@ -65,17 +65,21 @@ public class IconResponse {
private Bitmap bitmap;
private int color;
private boolean fromNetwork;
private boolean fromMemory;
private boolean fromDisk;
private boolean generated;
private String url;
- private IconResponse(@NonNull Bitmap bitmap) {
+ private IconResponse(Bitmap bitmap) {
+ if (bitmap == null) {
+ throw new NullPointerException("Bitmap is null");
+ }
+
this.bitmap = bitmap;
this.color = 0;
this.url = null;
this.fromNetwork = false;
this.fromMemory = false;
this.fromDisk = false;
this.generated = false;
}