aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-07-15 18:26:38 -0700
committerScott Jackson <daneren2005@gmail.com>2014-07-15 18:26:38 -0700
commit3f74c6b9523125ade8f93fe3803de0a36cf1b251 (patch)
tree4e7e744a34b9bc6954bb677b82099e9416c54b12
parentd3a6d5974a98cdd6ce1944b67cffa0666c62c56b (diff)
downloaddsub-3f74c6b9523125ade8f93fe3803de0a36cf1b251.tar.gz
dsub-3f74c6b9523125ade8f93fe3803de0a36cf1b251.tar.bz2
dsub-3f74c6b9523125ade8f93fe3803de0a36cf1b251.zip
Get rid of background errors on each user with no avatar
-rw-r--r--src/github/daneren2005/dsub/util/FileUtil.java6
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);