Skip to content

Commit

Permalink
Fix null reference error with form/costume
Browse files Browse the repository at this point in the history
  • Loading branch information
versx committed Jan 11, 2021
1 parent 33ea28c commit fd4abda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Net/Webhooks/WebhookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}.");
Expand All @@ -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}.");
Expand Down

0 comments on commit fd4abda

Please sign in to comment.