Skip to content

Commit

Permalink
Crash fixes
Browse files Browse the repository at this point in the history
fixes #854
  • Loading branch information
grishka committed Jun 23, 2024
1 parent 6d96ab5 commit 501a271
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mastodon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
applicationId "org.joinmastodon.android"
minSdk 23
targetSdk 33
versionCode 103
versionCode 104
versionName "2.5.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ public void onSuccess(Status result){
sendingOverlay=null;
removeBackCallback(sendingBackButtonBlocker);
removeBackCallback(discardConfirmationCallback);
removeBackCallback(emojiKeyboardHider);
if(editingStatus==null){
E.post(new StatusCreatedEvent(result, accountID));
if(replyTo!=null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ protected Holder(Activity activity, @LayoutRes int layout, ViewGroup parent){
more=findViewById(R.id.more);
extraText=findViewById(R.id.extra_text);
clickableThing=findViewById(R.id.clickable_thing);
clickableThing.setOnClickListener(this::onAvaClick);
if(clickableThing!=null)
clickableThing.setOnClickListener(this::onAvaClick);
avatar.setOutlineProvider(OutlineProviders.roundedRect(10));
avatar.setClipToOutline(true);
more.setOnClickListener(this::onMoreClick);
Expand Down Expand Up @@ -272,8 +273,10 @@ public void onBind(HeaderStatusDisplayItem item){
extraText.setText(item.extraText);
}
more.setVisibility(item.inset ? View.GONE : View.VISIBLE);
clickableThing.setClickable(!item.inset);
clickableThing.setContentDescription(item.parentFragment.getString(R.string.avatar_description, item.user.acct));
if(clickableThing!=null){
clickableThing.setClickable(!item.inset);
clickableThing.setContentDescription(item.parentFragment.getString(R.string.avatar_description, item.user.acct));
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public void setAltTextByID(String attID, String text){
}

public List<String> getAttachmentIDs(){
return attachments.stream().map(a->a.serverAttachment.id).collect(Collectors.toList());
return attachments.stream().filter(a->a.serverAttachment!=null).map(a->a.serverAttachment.id).collect(Collectors.toList());
}

public List<CreateStatus.Request.MediaAttribute> getAttachmentAttributes(){
Expand Down

0 comments on commit 501a271

Please sign in to comment.