check if inputstream is null before cropping avatar images
This commit is contained in:
parent
9ebd6d503c
commit
6e1870b00a
|
@ -385,6 +385,9 @@ public class FileBackend {
|
|||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = calcSampleSize(image, size);
|
||||
is = mXmppConnectionService.getContentResolver().openInputStream(image);
|
||||
if (is == null) {
|
||||
return null;
|
||||
}
|
||||
Bitmap input = BitmapFactory.decodeStream(is, null, options);
|
||||
if (input == null) {
|
||||
return null;
|
||||
|
@ -411,6 +414,9 @@ public class FileBackend {
|
|||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = calcSampleSize(image,Math.max(newHeight, newWidth));
|
||||
is = mXmppConnectionService.getContentResolver().openInputStream(image);
|
||||
if (is == null) {
|
||||
return null;
|
||||
}
|
||||
Bitmap source = BitmapFactory.decodeStream(is, null, options);
|
||||
if (source == null) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue