aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2011-12-16 12:09:13 -0600
committerAndy Doan <andy.doan@linaro.org>2011-12-16 14:50:25 -0600
commit7e1760009817c08ca17344167b35453388ec83a8 (patch)
tree2d06d2d4b3a38046d1b5bc2eb103df89c1b8e957
parentd503d527ffc0ecf2f47e40293039e698f0af0a86 (diff)
downloadLinaroConnect-7e1760009817c08ca17344167b35453388ec83a8.tar.gz
fix null pointer issue with cache
if the file has never existed we are hitting an exception that requires you to refresh your screen. This handles the null pointer so that things work as expected
-rw-r--r--src/org/linaro/connect/CachedLayoutAdapter.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/linaro/connect/CachedLayoutAdapter.java b/src/org/linaro/connect/CachedLayoutAdapter.java
index aa25667..16b9e47 100644
--- a/src/org/linaro/connect/CachedLayoutAdapter.java
+++ b/src/org/linaro/connect/CachedLayoutAdapter.java
@@ -129,8 +129,10 @@ public abstract class CachedLayoutAdapter<T,K> extends ArrayAdapter<T> {
Log.e(LinaroConnect.TAG, "Error dowloading for cache: " + urls[0], e);
}
+ String orig = null;
InputStream is = getInputStream();
- String orig = JSONUtils.toString(is);
+ if( is != null )
+ orig = JSONUtils.toString(is);
layoutChanged = ( contentNew != null && !contentNew.equals(orig) );
if( layoutChanged) {