mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Check the part stream is non-null before decoding
// FREEBIE Closes #2459
This commit is contained in:
parent
aa26785c00
commit
5bd8d6c69d
@ -80,7 +80,9 @@ public class BitmapUtil {
|
|||||||
private static Bitmap createScaledBitmap(Context context, MasterSecret masterSecret, Uri uri, int maxWidth, int maxHeight, boolean constrainedMemory)
|
private static Bitmap createScaledBitmap(Context context, MasterSecret masterSecret, Uri uri, int maxWidth, int maxHeight, boolean constrainedMemory)
|
||||||
throws IOException, BitmapDecodingException
|
throws IOException, BitmapDecodingException
|
||||||
{
|
{
|
||||||
return createScaledBitmap(PartAuthority.getPartStream(context, masterSecret, uri),
|
InputStream is = PartAuthority.getPartStream(context, masterSecret, uri);
|
||||||
|
if (is == null) throw new IOException("Couldn't obtain InputStream");
|
||||||
|
return createScaledBitmap(is,
|
||||||
PartAuthority.getPartStream(context, masterSecret, uri),
|
PartAuthority.getPartStream(context, masterSecret, uri),
|
||||||
PartAuthority.getPartStream(context, masterSecret, uri),
|
PartAuthority.getPartStream(context, masterSecret, uri),
|
||||||
maxWidth, maxHeight, constrainedMemory);
|
maxWidth, maxHeight, constrainedMemory);
|
||||||
|
Loading…
Reference in New Issue
Block a user