mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
fix gif NPE
// FREEBIE
This commit is contained in:
parent
a2d63d117b
commit
24e14cbc73
@ -88,7 +88,7 @@ public class AttachmentManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setImage(MasterSecret masterSecret, Uri image) throws IOException, BitmapDecodingException {
|
public void setImage(MasterSecret masterSecret, Uri image) throws IOException, BitmapDecodingException {
|
||||||
if (MediaUtil.getMimeType(context, image).startsWith("image/gif")) {
|
if (MediaUtil.isGif(MediaUtil.getMimeType(context, image))) {
|
||||||
setMedia(new GifSlide(context, masterSecret, image), masterSecret);
|
setMedia(new GifSlide(context, masterSecret, image), masterSecret);
|
||||||
} else {
|
} else {
|
||||||
setMedia(new ImageSlide(context, masterSecret, image), masterSecret);
|
setMedia(new ImageSlide(context, masterSecret, image), masterSecret);
|
||||||
|
@ -84,7 +84,7 @@ public class MediaUtil {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isGif(String contentType) {
|
public static boolean isGif(String contentType) {
|
||||||
return !TextUtils.isEmpty(contentType) && contentType.trim().equals("image/gif");
|
return !TextUtils.isEmpty(contentType) && contentType.trim().equals("image/gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user