summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ContentManagers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-08-20 17:01:59 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-08-20 17:01:59 -0400
commita1bc96d365dc40275f198668d3f4c09bd7a92613 (patch)
tree5a130399bf8031aa70defb71a121b740d7c6cd7a /src/SMAPI/Framework/ContentManagers
parentd51ffe58f7b7450cd4c4a7ee3d8b4da1cf55e7e4 (diff)
parentf3a79219e85c9af18f2f6d8b2aaa794afa08578d (diff)
downloadSMAPI-a1bc96d365dc40275f198668d3f4c09bd7a92613.tar.gz
SMAPI-a1bc96d365dc40275f198668d3f4c09bd7a92613.tar.bz2
SMAPI-a1bc96d365dc40275f198668d3f4c09bd7a92613.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ContentManagers')
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
index f3cf05d9..8ecbc4cc 100644
--- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
@@ -254,6 +254,10 @@ namespace StardewModdingAPI.Framework.ContentManagers
{
using FileStream stream = File.OpenRead(file.FullName);
using SKBitmap bitmap = SKBitmap.Decode(stream);
+
+ if (bitmap is null)
+ throw new InvalidDataException($"Failed to load {file.FullName}. This doesn't seem to be a valid PNG image.");
+
rawPixels = SKPMColor.PreMultiply(bitmap.Pixels);
width = bitmap.Width;
height = bitmap.Height;