diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-07-15 18:26:38 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-07-15 18:26:38 -0700 |
commit | 3f74c6b9523125ade8f93fe3803de0a36cf1b251 (patch) | |
tree | 4e7e744a34b9bc6954bb677b82099e9416c54b12 /src | |
parent | d3a6d5974a98cdd6ce1944b67cffa0666c62c56b (diff) | |
download | dsub-3f74c6b9523125ade8f93fe3803de0a36cf1b251.tar.gz dsub-3f74c6b9523125ade8f93fe3803de0a36cf1b251.tar.bz2 dsub-3f74c6b9523125ade8f93fe3803de0a36cf1b251.zip |
Get rid of background errors on each user with no avatar
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/util/FileUtil.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index ead17f5d..205b3e15 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -237,7 +237,11 @@ public class FileUtil { opt.inSampleSize = Util.calculateInSampleSize(opt, size, Util.getScaledHeight(opt.outHeight, opt.outWidth, size)); opt.inJustDecodeBounds = false; Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length, opt); - return getScaledBitmap(bitmap, size); + if(bitmap == null) { + return null; + } else { + return getScaledBitmap(bitmap, size); + } } public static Bitmap getScaledBitmap(Bitmap bitmap, int size) { return Bitmap.createScaledBitmap(bitmap, size, Util.getScaledHeight(bitmap, size), true); |