diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-08-20 17:01:59 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-08-20 17:01:59 -0400 |
commit | a1bc96d365dc40275f198668d3f4c09bd7a92613 (patch) | |
tree | 5a130399bf8031aa70defb71a121b740d7c6cd7a /src/SMAPI/Framework/ContentManagers | |
parent | d51ffe58f7b7450cd4c4a7ee3d8b4da1cf55e7e4 (diff) | |
parent | f3a79219e85c9af18f2f6d8b2aaa794afa08578d (diff) | |
download | SMAPI-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.cs | 4 |
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; |