From fd4abda25ec160ee5a9f53201f156f5e15572ad6 Mon Sep 17 00:00:00 2001 From: versx Date: Mon, 11 Jan 2021 00:51:41 -0800 Subject: [PATCH] Fix null reference error with form/costume --- src/Net/Webhooks/WebhookController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Net/Webhooks/WebhookController.cs b/src/Net/Webhooks/WebhookController.cs index 454c4f40..e0600dcb 100644 --- a/src/Net/Webhooks/WebhookController.cs +++ b/src/Net/Webhooks/WebhookController.cs @@ -581,7 +581,7 @@ private void ProcessPokemon(PokemonData pkmn) continue; } - var formName = Translator.Instance.GetFormName(pkmn.FormId).ToLower(); + var formName = Translator.Instance.GetFormName(pkmn.FormId)?.ToLower(); if (alarm.Filters.Pokemon.FilterType == FilterType.Exclude && alarm.Filters.Pokemon.Forms.Select(x => x.ToLower()).Contains(formName)) { //_logger.Info($"[{alarm.Name}] [{geofence.Name}] Skipping pokemon {pkmn.Id} with form {pkmn.FormId} ({formName}): filter {alarm.Filters.Pokemon.FilterType}."); @@ -594,7 +594,7 @@ private void ProcessPokemon(PokemonData pkmn) continue; } - var costumeName = Translator.Instance.GetCostumeName(pkmn.Costume).ToLower(); + var costumeName = Translator.Instance.GetCostumeName(pkmn.Costume)?.ToLower(); if (alarm.Filters.Pokemon.FilterType == FilterType.Exclude && alarm.Filters.Pokemon.Costumes.Select(x => x.ToLower()).Contains(costumeName)) { //_logger.Info($"[{alarm.Name}] [{geofence.Name}] Skipping pokemon {pkmn.Id} with costume {pkmn.Costume} ({costumeName}): filter {alarm.Filters.Pokemon.FilterType}.");