Prevent possible requireContext() crash when updating link preview.

fork-5.53.8
Greyson Parrelli 2022-02-04 09:38:30 -05:00
rodzic 45668e4048
commit b081452bed
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -3149,7 +3149,7 @@ public class ConversationParentFragment extends Fragment
}
private void updateLinkPreviewState() {
if (SignalStore.settings().isLinkPreviewsEnabled() && isSecureText && !sendButton.getSelectedTransport().isSms() && !attachmentManager.isAttachmentPresent()) {
if (SignalStore.settings().isLinkPreviewsEnabled() && isSecureText && !sendButton.getSelectedTransport().isSms() && !attachmentManager.isAttachmentPresent() && getContext() != null) {
linkPreviewViewModel.onEnabled();
linkPreviewViewModel.onTextChanged(requireContext(), composeText.getTextTrimmed().toString(), composeText.getSelectionStart(), composeText.getSelectionEnd());
} else {