Skip to content

Commit b15913c

Browse files
Fix HubHelpers field references causing build error (#6487)
1 parent dd1f0a1 commit b15913c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/Notifications/HubHelpers.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,24 @@ await _hubContext.Clients
162162
var organizationBankAccountVerifiedNotification =
163163
JsonSerializer.Deserialize<PushNotificationData<OrganizationBankAccountVerifiedPushNotification>>(
164164
notificationJson, _deserializerOptions);
165-
await hubContext.Clients.Group(NotificationsHub.GetOrganizationGroup(organizationBankAccountVerifiedNotification.Payload.OrganizationId))
165+
if (organizationBankAccountVerifiedNotification is null)
166+
{
167+
break;
168+
}
169+
170+
await _hubContext.Clients.Group(NotificationsHub.GetOrganizationGroup(organizationBankAccountVerifiedNotification.Payload.OrganizationId))
166171
.SendAsync(_receiveMessageMethod, organizationBankAccountVerifiedNotification, cancellationToken);
167172
break;
168173
case PushType.ProviderBankAccountVerified:
169174
var providerBankAccountVerifiedNotification =
170175
JsonSerializer.Deserialize<PushNotificationData<ProviderBankAccountVerifiedPushNotification>>(
171176
notificationJson, _deserializerOptions);
172-
await hubContext.Clients.User(providerBankAccountVerifiedNotification.Payload.AdminId.ToString())
177+
if (providerBankAccountVerifiedNotification is null)
178+
{
179+
break;
180+
}
181+
182+
await _hubContext.Clients.User(providerBankAccountVerifiedNotification.Payload.AdminId.ToString())
173183
.SendAsync(_receiveMessageMethod, providerBankAccountVerifiedNotification, cancellationToken);
174184
break;
175185
case PushType.Notification:
@@ -222,7 +232,7 @@ await _hubContext.Clients.User(pendingTasksData.Payload.UserId.ToString())
222232
.SendAsync(_receiveMessageMethod, pendingTasksData, cancellationToken);
223233
break;
224234
default:
225-
logger.LogWarning("Notification type '{NotificationType}' has not been registered in HubHelpers and will not be pushed as as result", notification.Type);
235+
_logger.LogWarning("Notification type '{NotificationType}' has not been registered in HubHelpers and will not be pushed as as result", notification.Type);
226236
break;
227237
}
228238
}

0 commit comments

Comments
 (0)