Skip to content

Commit

Permalink
use tryparse instead of parse
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikus1993 committed May 5, 2024
1 parent fcbd1e7 commit 0172d75
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ public static GameNameFilter Produce(string filePath)
var res = new List<FuzzGame>();
foreach (var row in reader)
{
var title = row["Title"].Parse<string>();
res.Add(new FuzzGame(title));
var titleColumn = row["Title"];
if (titleColumn.TryParse<string>(out var title))
{
res.Add(new FuzzGame(title));
}
}

return new GameNameFilter(res);
Expand Down

0 comments on commit 0172d75

Please sign in to comment.