mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 05:27:42 +00:00
Fix crash when opening reactions bottom sheet.
This commit is contained in:
committed by
Greyson Parrelli
parent
fd6a2c6b10
commit
6919e352d6
@@ -1582,16 +1582,16 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
|
||||
@Override
|
||||
public void onReactionClicked(@NonNull MultiselectPart multiselectPart, long messageId, boolean isMms) {
|
||||
if (getContext() == null) return;
|
||||
if (getParentFragment() == null) return;
|
||||
|
||||
ReactionsBottomSheetDialogFragment.create(messageId, isMms).show(requireFragmentManager(), null);
|
||||
ReactionsBottomSheetDialogFragment.create(messageId, isMms).show(getParentFragmentManager(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberClicked(@NonNull RecipientId recipientId, @NonNull GroupId groupId) {
|
||||
if (getContext() == null) return;
|
||||
if (getParentFragment() == null) return;
|
||||
|
||||
RecipientBottomSheetDialogFragment.create(recipientId, groupId).show(requireFragmentManager(), "BOTTOM");
|
||||
RecipientBottomSheetDialogFragment.create(recipientId, groupId).show(getParentFragmentManager(), "BOTTOM");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1647,7 +1647,11 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
|
||||
@Override
|
||||
public void onGroupMigrationLearnMoreClicked(@NonNull GroupMigrationMembershipChange membershipChange) {
|
||||
GroupsV1MigrationInfoBottomSheetDialogFragment.show(requireFragmentManager(), membershipChange);
|
||||
if (getParentFragment() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
GroupsV1MigrationInfoBottomSheetDialogFragment.show(getParentFragmentManager(), membershipChange);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,7 +57,13 @@ public final class ReactionsBottomSheetDialogFragment extends BottomSheetDialogF
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
callback = (Callback) context;
|
||||
if (context instanceof Callback) {
|
||||
callback = (Callback) context;
|
||||
} else if (getParentFragment() instanceof Callback) {
|
||||
callback = (Callback) getParentFragment();
|
||||
} else {
|
||||
throw new IllegalStateException("Parent component does not implement Callback");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user