aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/src/main/java/com/bumptech/glide/load/resource/bitmap/GlideBitmapDrawable.java4
-rw-r--r--library/src/main/java/com/bumptech/glide/load/resource/gif/GifDrawable.java4
2 files changed, 8 insertions, 0 deletions
diff --git a/library/src/main/java/com/bumptech/glide/load/resource/bitmap/GlideBitmapDrawable.java b/library/src/main/java/com/bumptech/glide/load/resource/bitmap/GlideBitmapDrawable.java
index e2589131..27e05185 100644
--- a/library/src/main/java/com/bumptech/glide/load/resource/bitmap/GlideBitmapDrawable.java
+++ b/library/src/main/java/com/bumptech/glide/load/resource/bitmap/GlideBitmapDrawable.java
@@ -29,6 +29,10 @@ public class GlideBitmapDrawable extends GlideDrawable {
}
GlideBitmapDrawable(Resources res, BitmapState state) {
+ if (state == null) {
+ throw new NullPointerException("BitmapState must not be null");
+ }
+
this.state = state;
final int targetDensity;
if (res != null) {
diff --git a/library/src/main/java/com/bumptech/glide/load/resource/gif/GifDrawable.java b/library/src/main/java/com/bumptech/glide/load/resource/gif/GifDrawable.java
index 68e6a788..47e06fb5 100644
--- a/library/src/main/java/com/bumptech/glide/load/resource/gif/GifDrawable.java
+++ b/library/src/main/java/com/bumptech/glide/load/resource/gif/GifDrawable.java
@@ -75,6 +75,10 @@ public class GifDrawable extends GlideDrawable implements GifFrameManager.FrameC
}
GifDrawable(GifState state) {
+ if (state == null) {
+ throw new NullPointerException("GifState must not be null");
+ }
+
this.state = state;
this.decoder = new GifDecoder(state.bitmapProvider);
decoder.setData(state.gifHeader, state.data);