Skip to content

Commit

Permalink
fix nullpointer on generated cards like Cthun
Browse files Browse the repository at this point in the history
  • Loading branch information
icetbr committed Jan 11, 2021
1 parent ed3fc10 commit 080c430
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Advisor/Advisor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
Expand Down Expand Up @@ -268,7 +268,12 @@ internal async void UpdateCardList()
// Remove already played opponent cards from predicted archetype deck. But don't remove revealed jousted cards, because they were only seen and not played yet.
if (predictedCards.Contains(card))
{
var item = predictedCards.Find(x => x.Id == card.Id);
// var item = predictedCards.Find(x => x.Id == card.Id); // previous version
var item = predictedCards.Find(x => x.Id == card.Id || x.Id.Equals(card.Id)); // trying this vriation
//var match = predictedCards.FirstOrDefault(stringToCheck => stringToCheck.Contains(myString)); // if thee above doesn't work, try this?

// fixes nullpointer, not sure whats the problem, maybe its gift cards, maybe cards not on preddicted list (like cthun cards)
if (item == null) continue;

if (!card.Jousted)
{
Expand Down

0 comments on commit 080c430

Please sign in to comment.