aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Judd <judds@google.com>2014-11-06 07:53:08 -0800
committerSam Judd <judds@google.com>2014-11-06 07:53:08 -0800
commit72e189cc27d62677a7e45dc5ddfcf4cc0d6466ab (patch)
tree8a5945634b3e5042c9bc3777b2bc793ceb438983
parentf7a6d65cf7c1a41908dd48e0dab68ee5b881387e (diff)
downloadglide-72e189cc27d62677a7e45dc5ddfcf4cc0d6466ab.tar.gz
Explicitly verify state is non null in Drawables.
Related to #233.
-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);