From fd3b64c6bff3cabe14088e9f6c26b60c06104423 Mon Sep 17 00:00:00 2001 From: Adam Dixon Date: Thu, 20 Jun 2024 09:08:40 -0500 Subject: [PATCH] handle nre --- mqttlistener/Forward.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mqttlistener/Forward.cs b/mqttlistener/Forward.cs index 51f3b33..9d618c3 100644 --- a/mqttlistener/Forward.cs +++ b/mqttlistener/Forward.cs @@ -78,9 +78,9 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Function, " return new BadRequestResult(); } - if (payload.Resource.Revision.Fields.SystemWorkItemType != "Bug") + if (payload.Resource?.Revision?.Fields?.SystemWorkItemType != "Bug") { - logger.LogInformation("Ignoring work item type: {WorkItemType}", payload.Resource.Revision.Fields.SystemWorkItemType); + logger.LogInformation("Ignoring work item type: {WorkItemType}", payload.Resource?.Revision?.Fields?.SystemWorkItemType); return new OkResult(); }