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

@@ -102,8 +102,11 @@ public class MessageSender {
* Suitable for a 1:1 conversation or a GV1 group only.
*/
@WorkerThread
public static void sendProfileKey(final Context context, final long threadId) {
ApplicationDependencies.getJobManager().add(ProfileKeySendJob.create(context, threadId, false));
public static void sendProfileKey(final long threadId) {
ProfileKeySendJob job = ProfileKeySendJob.create(threadId, false);
if (job != null) {
ApplicationDependencies.getJobManager().add(job);
}
}
public static long send(final Context context,