From c3ffed56da4e5110138b5dba97ca4dca4e5f08db Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Tue, 17 Oct 2017 09:37:59 +0200 Subject: [PATCH] fix a bug where saving a toot with attached media would crash the app --- .../main/java/com/keylesspalace/tusky/ComposeActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index 90948ab41..b34e05ae3 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -687,7 +687,9 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm if (!ListUtils.isEmpty(savedList)) { String json = new Gson().toJson(savedList); toot.setUrls(json); - deleteMedia(setDifference(existingUris, savedList)); + if(!ListUtils.isEmpty(existingUris)) { + deleteMedia(setDifference(existingUris, savedList)); + } } else { return false; }