Merge branch 'master' into dev

This commit is contained in:
Niels Andriesse 2021-07-09 09:25:16 +10:00
commit 9fd2788664
4 changed files with 4 additions and 2 deletions

View File

@ -1277,7 +1277,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
}
private fun saveDraft() {
val text = inputBar.text.trim()
val text = inputBar?.text?.trim() ?: return
if (text.isEmpty()) { return }
val drafts = Drafts()
drafts.add(DraftDatabase.Draft(DraftDatabase.Draft.TEXT, text))

View File

@ -83,7 +83,7 @@ class VisibleMessageView : LinearLayout {
val senderSessionID = sender.address.serialize()
val threadID = message.threadId
val threadDB = DatabaseFactory.getThreadDatabase(context)
val thread = threadDB.getRecipientForThreadId(threadID)!!
val thread = threadDB.getRecipientForThreadId(threadID) ?: return
val contactDB = DatabaseFactory.getSessionContactDatabase(context)
val isGroupThread = thread.isGroupRecipient
val isStartOfMessageCluster = isStartOfMessageCluster(message, previous, isGroupThread)

View File

@ -883,6 +883,7 @@ public class MmsDatabase extends MessagingDatabase {
}
public void deleteQuotedFromMessages(MessageRecord toDeleteRecord) {
if (toDeleteRecord == null) { return; }
String query = THREAD_ID + " = ?";
Cursor threadMmsCursor = rawQuery(query, new String[]{String.valueOf(toDeleteRecord.getThreadId())});
Reader reader = readerFor(threadMmsCursor);

View File

@ -191,6 +191,7 @@ class EnterPublicKeyFragment : Fragment() {
}
private fun handleIsKeyboardShowingChanged() {
val optionalContentContainer = optionalContentContainer ?: return
optionalContentContainer.isVisible = !isKeyboardShowing
}