From 3f74c6b9523125ade8f93fe3803de0a36cf1b251 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 15 Jul 2014 18:26:38 -0700 Subject: Get rid of background errors on each user with no avatar --- src/github/daneren2005/dsub/util/FileUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3