summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFicus Kirkpatrick <ficus@android.com>2013-07-01 12:38:32 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-01 12:38:32 -0700
commita4a4135c97ee4de94df78630cbe48965b19c9513 (patch)
treedb1775295eb3d9cac321ec25d557a20ab277218d
parent527ca5b024a49d7fe4836bfe6b61f93e64a0274c (diff)
parent5a1110cb7c24370dd6385df92211d46a82a8e3f8 (diff)
downloadvolley-a4a4135c97ee4de94df78630cbe48965b19c9513.tar.gz
am 5a1110cb: am 3c479905: Merge "NetworkImage - fix nullPointerException."
* commit '5a1110cb7c24370dd6385df92211d46a82a8e3f8': NetworkImage - fix nullPointerException.
-rw-r--r--src/com/android/volley/toolbox/NetworkImageView.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/volley/toolbox/NetworkImageView.java b/src/com/android/volley/toolbox/NetworkImageView.java
index d4f14e9..74c9159 100644
--- a/src/com/android/volley/toolbox/NetworkImageView.java
+++ b/src/com/android/volley/toolbox/NetworkImageView.java
@@ -18,8 +18,8 @@ package com.android.volley.toolbox;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
+import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
-import android.widget.LinearLayout.LayoutParams;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader.ImageContainer;
@@ -104,7 +104,8 @@ public class NetworkImageView extends ImageView {
int width = getWidth();
int height = getHeight();
- boolean isFullyWrapContent = getLayoutParams().height == LayoutParams.WRAP_CONTENT
+ boolean isFullyWrapContent = getLayoutParams() != null
+ && getLayoutParams().height == LayoutParams.WRAP_CONTENT
&& getLayoutParams().width == LayoutParams.WRAP_CONTENT;
// if the view's bounds aren't known yet, and this is not a wrap-content/wrap-content
// view, hold off on loading the image.