diff options
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 5cfc1116..e71f4cbb 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -1050,10 +1050,10 @@ public class ConversationActivity extends XmppActivity @Override public void OnUpdateBlocklist(Status status) { - invalidateOptionsMenu(); runOnUiThread(new Runnable() { @Override public void run() { + invalidateOptionsMenu(); ConversationActivity.this.mConversationFragment.updateMessages(); } }); diff --git a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java index 5e770376..a3904d21 100644 --- a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java @@ -134,11 +134,12 @@ public class ShareWithActivity extends XmppActivity { @Override public void onStart() { final String type = getIntent().getType(); - if (type != null && !type.startsWith("text/")) { - this.share.uri = (Uri) getIntent().getParcelableExtra(Intent.EXTRA_STREAM); + final Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM); + if (type != null && uri != null && !type.startsWith("text/")) { + this.share.uri = uri; try { - this.share.image = type.startsWith("image/") - || URLConnection.guessContentTypeFromName(this.share.uri.toString()).startsWith("image/"); + String guess = URLConnection.guessContentTypeFromName(uri.toString()); + this.share.image = type.startsWith("image/") || (guess != null && guess.startsWith("image/")); } catch (final StringIndexOutOfBoundsException ignored) { this.share.image = false; } |