Prevent crash if a call doesn't have a message associated with it.

This commit is contained in:
Alex Hart
2024-01-18 16:00:47 -04:00
committed by Greyson Parrelli
parent ce9a8f62d4
commit f81dc11f61

View File

@@ -128,7 +128,12 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
if (call != null) {
Log.i(TAG, "Updated call: $callId event: $event")
SignalDatabase.messages.updateCallLog(call.messageId!!, call.messageType)
if (call.messageId == null) {
Log.w(TAG, "Call does not have an associated message id! No message to update.")
} else {
SignalDatabase.messages.updateCallLog(call.messageId, call.messageType)
}
ApplicationDependencies.getMessageNotifier().updateNotification(context)
ApplicationDependencies.getDatabaseObserver().notifyCallUpdateObservers()
}