Skip to content

Commit

Permalink
Fix null reference exception in swinfo transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jan 15, 2024
1 parent 62a0bc7 commit 6a37a32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Netkan/Transformers/SpaceWarpInfoTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public IEnumerable<Metadata> Transform(Metadata metadata, TransformOptions opts)
json.SafeAdd("author", swinfo.author);
json.SafeAdd("abstract", swinfo.description);
json.SafeAdd("version", swinfo.version);
GameVersion maxVer = null;
if (GameVersion.TryParse(swinfo.ksp2_version.min, out GameVersion minVer)
|| GameVersion.TryParse(swinfo.ksp2_version.max, out maxVer))
bool hasMin = GameVersion.TryParse(swinfo.ksp2_version?.min, out GameVersion minVer);
bool hasMax = GameVersion.TryParse(swinfo.ksp2_version?.max, out GameVersion maxVer);
if (hasMin || hasMax)
{
log.InfoFormat("Found compatibility: {0}–{1}", minVer?.WithoutBuild,
maxVer?.WithoutBuild);
Expand Down

0 comments on commit 6a37a32

Please sign in to comment.