Fix possible crash in ProfileKeySendJob if given an invalid threadId.

This commit is contained in:
Greyson Parrelli
2022-07-01 11:06:37 -04:00
parent e413ee4ed9
commit be2ed8989f
5 changed files with 20 additions and 10 deletions

View File

@@ -1153,7 +1153,6 @@ public class ThreadDatabase extends Database {
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
try (Cursor cursor = db.query(TABLE_NAME, RECIPIENT_ID_PROJECTION, ID_WHERE, SqlUtil.buildArgs(threadId), null, null, null)) {
if (cursor != null && cursor.moveToFirst()) {
return RecipientId.from(cursor.getLong(cursor.getColumnIndexOrThrow(RECIPIENT_ID)));
}