diff --git a/library/src/main/java/com/bumptech/glide/request/SingleRequest.java b/library/src/main/java/com/bumptech/glide/request/SingleRequest.java index 211936b20e..3bea82af4a 100644 --- a/library/src/main/java/com/bumptech/glide/request/SingleRequest.java +++ b/library/src/main/java/com/bumptech/glide/request/SingleRequest.java @@ -387,7 +387,8 @@ public boolean isAnyResourceSet() { private Drawable getErrorDrawable() { if (errorDrawable == null) { errorDrawable = requestOptions.getErrorPlaceholder(); - if (errorDrawable == null && requestOptions.getErrorId() > 0) { + if (errorDrawable == null && requestOptions.getErrorId() != -1 && + (requestOptions.getErrorId() & 0xff000000) != 0 && (requestOptions.getErrorId() & 0x00ff0000) != 0) { errorDrawable = loadDrawable(requestOptions.getErrorId()); } } @@ -398,7 +399,8 @@ private Drawable getErrorDrawable() { private Drawable getPlaceholderDrawable() { if (placeholderDrawable == null) { placeholderDrawable = requestOptions.getPlaceholderDrawable(); - if (placeholderDrawable == null && requestOptions.getPlaceholderId() > 0) { + if (placeholderDrawable == null && requestOptions.getPlaceholderId() != -1 && + (requestOptions.getPlaceholderId() & 0xff000000) != 0 && (requestOptions.getPlaceholderId() & 0x00ff0000) != 0) { placeholderDrawable = loadDrawable(requestOptions.getPlaceholderId()); } } @@ -409,7 +411,8 @@ private Drawable getPlaceholderDrawable() { private Drawable getFallbackDrawable() { if (fallbackDrawable == null) { fallbackDrawable = requestOptions.getFallbackDrawable(); - if (fallbackDrawable == null && requestOptions.getFallbackId() > 0) { + if (fallbackDrawable == null && requestOptions.getFallbackId() != -1 && + (requestOptions.getFallbackId() & 0xff000000) != 0 && (requestOptions.getFallbackId() & 0x00ff0000) != 0) { fallbackDrawable = loadDrawable(requestOptions.getFallbackId()); } }