npe check after reading image uri
This commit is contained in:
parent
d94c231a74
commit
6a15bc26b6
|
@ -400,7 +400,9 @@ public class FileBackend {
|
|||
options.inSampleSize = calcSampleSize(image,Math.max(newHeight, newWidth));
|
||||
is = mXmppConnectionService.getContentResolver().openInputStream(image);
|
||||
Bitmap source = BitmapFactory.decodeStream(is, null, options);
|
||||
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
int sourceWidth = source.getWidth();
|
||||
int sourceHeight = source.getHeight();
|
||||
float xScale = (float) newWidth / sourceWidth;
|
||||
|
@ -418,8 +420,6 @@ public class FileBackend {
|
|||
return dest;
|
||||
} catch (FileNotFoundException e) {
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
} finally {
|
||||
close(is);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue