mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 10:06:47 +00:00
Check for null FCM error codes
This commit is contained in:
1 parent
c9ae991aa3
commit
8956e1e0cf
1 file changed
+10
-1
@@ -87,7 +87,16 @@ public class FcmSender {
|
||||
sendFuture.get();
|
||||
} catch (ExecutionException e) {
|
||||
if (e.getCause() instanceof final FirebaseMessagingException firebaseMessagingException) {
|
||||
tags = tags.and("errorCode", firebaseMessagingException.getMessagingErrorCode().name().toLowerCase());
|
||||
final String errorCode;
|
||||
|
||||
if (firebaseMessagingException.getMessagingErrorCode() != null) {
|
||||
errorCode = firebaseMessagingException.getMessagingErrorCode().name().toLowerCase();
|
||||
} else {
|
||||
logger.warn("Received an FCM exception with no error code", firebaseMessagingException);
|
||||
errorCode = "unknown";
|
||||
}
|
||||
|
||||
tags = tags.and("errorCode", errorCode);
|
||||
|
||||
switch (firebaseMessagingException.getMessagingErrorCode()) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user