From d72f66b9bfcddce7800bfcec8205f6d2871667ff Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sat, 3 Jun 2023 20:25:27 -0300 Subject: [PATCH] fix: NPE when getInstance().pleroma.metadata.fieldsLimits is null --- .../org/joinmastodon/android/fragments/ProfileFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 0527cb61f..42637ec4c 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -198,7 +198,9 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList if(!isOwnProfile) loadRelationship(); else if (isInstanceAkkoma() && getInstance().isPresent()) - maxFields = getInstance().get().pleroma.metadata.fieldsLimits.maxFields; + if(getInstance().get().pleroma != null && getInstance().get().pleroma.metadata != null && getInstance().get().pleroma.metadata.fieldsLimits != null){ + maxFields = getInstance().get().pleroma.metadata.fieldsLimits.maxFields; + } }else{ profileAccountID=getArguments().getString("profileAccountID"); if(!getArguments().getBoolean("noAutoLoad", false))