backport requireActivity method

This commit is contained in:
Daniel Gultsch 2021-09-21 11:55:37 +02:00
parent 64a6edd3fb
commit bd4d939a29

View file

@ -3051,4 +3051,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
activity.switchToAccount(message.getConversation().getAccount(), fingerprint);
}
private Activity requireActivity() {
final Activity activity = getActivity();
if (activity == null) {
throw new IllegalStateException("Activity not attached");
}
return activity;
}
}