diff --git a/mastodon/build.gradle b/mastodon/build.gradle index 2e55b8a2..2bcc4692 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -58,7 +58,7 @@ dependencies { implementation 'me.grishka.litex:dynamicanimation:1.1.0-alpha03' implementation 'me.grishka.litex:viewpager:1.0.0' implementation 'me.grishka.litex:viewpager2:1.0.0' - implementation 'me.grishka.appkit:appkit:1.2.2' + implementation 'me.grishka.appkit:appkit:1.2.3' implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.jsoup:jsoup:1.14.3' implementation 'com.squareup:otto:1.3.8' diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/MastodonAPIRequest.java b/mastodon/src/main/java/org/joinmastodon/android/api/MastodonAPIRequest.java index 8f38d138..0dc12ea9 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/MastodonAPIRequest.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/MastodonAPIRequest.java @@ -75,9 +75,14 @@ public abstract class MastodonAPIRequest extends APIRequest{ } public MastodonAPIRequest exec(String accountID){ - account=AccountSessionManager.getInstance().getAccount(accountID); - domain=account.domain; - account.getApiController().submitRequest(this); + try{ + account=AccountSessionManager.getInstance().getAccount(accountID); + domain=account.domain; + account.getApiController().submitRequest(this); + }catch(Exception x){ + Log.e(TAG, "exec: this shouldn't happen, but it still did", x); + invokeErrorCallback(new MastodonErrorResponse(x.getLocalizedMessage(), -1)); + } return this; } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index 6b26ac44..394a653b 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -1096,7 +1096,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr @Override public String[] onGetAllowedMediaMimeTypes(){ - if(instance.configuration!=null && instance.configuration.mediaAttachments!=null && instance.configuration.mediaAttachments.supportedMimeTypes!=null) + if(instance!=null && instance.configuration!=null && instance.configuration.mediaAttachments!=null && instance.configuration.mediaAttachments.supportedMimeTypes!=null) return instance.configuration.mediaAttachments.supportedMimeTypes.toArray(new String[0]); return new String[]{"image/jpeg", "image/gif", "image/png", "video/mp4"}; } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index a6b0dbe2..b442e8d7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -182,7 +182,7 @@ public class UiUtils{ String name=cursor.getString(0); if(name!=null) return name; - } + }catch(Throwable ignore){} } return uri.getLastPathSegment(); }