Skip to content

Commit

Permalink
fix: Handle null values in IconOverlayTypeString
Browse files Browse the repository at this point in the history
Address a potential null reference issue by adding null checks when retrieving the "p.IconOverlay" value from the data store and providing a default value of IconOverlay.Liaher.
  • Loading branch information
DineshSolanki committed Aug 1, 2024
1 parent c5f01e7 commit d019959
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FoliCon/Models/Constants/GlobalVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ public static IconOverlay IconOverlayType()
public const string MediaInfoFile = "info.folicon";

private static string IconOverlayTypeString =>
Services.Tracker.Store.GetData("PosterIconConfigViewModel")["p.IconOverlay"].ToString();
Services.Tracker.Store.GetData("PosterIconConfigViewModel")?["p.IconOverlay"]?.ToString() ?? IconOverlay.Liaher.ToString();
}

0 comments on commit d019959

Please sign in to comment.