Skip to content

Commit

Permalink
.NotNull will never return null, but cause Exception instead
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jun 26, 2024
1 parent 85c2ff6 commit e328d82
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,22 @@ public void HighlightModel(string modelCardId)

var objectIds = new List<string>();

if (model is SenderModelCard senderModelCard)
try
{
objectIds = senderModelCard.SendFilter.NotNull().GetObjectIds();
}

if (model is ReceiverModelCard receiverModelCard)
{
objectIds = receiverModelCard.BakedObjectIds.NotNull();
if (model is SenderModelCard senderModelCard)
{
objectIds = senderModelCard.SendFilter.NotNull().GetObjectIds();
}
else if (model is ReceiverModelCard receiverModelCard)
{
objectIds = receiverModelCard.BakedObjectIds.NotNull();
}
}

if (objectIds is null)
catch (ArgumentNullException)
{
return;
}

HighlightObjectsOnView(objectIds);
}

Expand Down

0 comments on commit e328d82

Please sign in to comment.