summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers/ModHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers/ModHelper.cs')
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModHelper.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/ModHelper.cs b/src/SMAPI/Framework/ModHelpers/ModHelper.cs
index d9498e83..0ba258b4 100644
--- a/src/SMAPI/Framework/ModHelpers/ModHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ModHelper.cs
@@ -138,7 +138,9 @@ namespace StardewModdingAPI.Framework.ModHelpers
where TModel : class
{
path = Path.Combine(this.DirectoryPath, PathUtilities.NormalisePathSeparators(path));
- return this.JsonHelper.ReadJsonFile<TModel>(path);
+ return this.JsonHelper.ReadJsonFileIfExists(path, out TModel data)
+ ? data
+ : null;
}
/// <summary>Save to a JSON file.</summary>