Skip to content

Commit

Permalink
Add null check to FCM error log condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-signal committed Feb 7, 2025
1 parent 760c573 commit 794e254
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public CompletableFuture<SendPushNotificationResult> sendNotification(PushNotifi

if (firebaseMessagingException.getMessagingErrorCode() != null) {
errorCode = firebaseMessagingException.getMessagingErrorCode().name();
if (firebaseMessagingException.getMessagingErrorCode() == MessagingErrorCode.QUOTA_EXCEEDED) {
if (firebaseMessagingException.getMessagingErrorCode() == MessagingErrorCode.QUOTA_EXCEEDED
&& firebaseMessagingException.getHttpResponse() != null) {
logger.info("FCM request failed with quota exceeded; retry-after: {}, response body: {}",
firebaseMessagingException.getHttpResponse().getHeaders().get("retry-after"),
firebaseMessagingException.getHttpResponse().getContent());
Expand Down

0 comments on commit 794e254

Please sign in to comment.