Skip to content

Commit

Permalink
Fix potential crash
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye116477 committed Jan 4, 2024
1 parent 69db93c commit 1c1eff4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/EpicMetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ public override GameMetadata GetMetadata(Game game)
{
gameInfo.ReleaseDate = new ReleaseDate(legendaryReleaseDate.Year, legendaryReleaseDate.Month, legendaryReleaseDate.Day);
}
var legendaryCover = legendaryMetadata.metadata.keyImages.FirstOrDefault(a => a.type == "DieselGameBoxTall").url;
if (!legendaryCover.IsNullOrEmpty())
var legendaryImages = legendaryMetadata.metadata.keyImages;
if (legendaryImages.Length > 0)
{
gameInfo.CoverImage = new MetadataFile(legendaryCover);
var legendaryCover = legendaryMetadata.metadata.keyImages?.FirstOrDefault(a => a.type == "DieselGameBoxTall").url;
if (!legendaryCover.IsNullOrEmpty())
{
gameInfo.CoverImage = new MetadataFile(legendaryCover);
}
}
gameInfo.Features = new HashSet<MetadataProperty>() { };
if (legendaryMetadata.metadata.customAttributes.CloudSaveFolder != null)
Expand Down

0 comments on commit 1c1eff4

Please sign in to comment.