From 353a49fdea0753968f54dc36a185bd1d2b219929 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 16 Jun 2018 22:40:51 +0200 Subject: catch NPE in exif detection --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 40cd257fb..e966ad109 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -814,7 +814,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } catch (IOException e) { e.printStackTrace(); } - orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); + orientation = exif != null ? exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) : 0; } Log.d(Config.LOGTAG, "EXIF: " + orientation); Bitmap rotated_image = null; -- cgit v1.2.3