summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authoratravita-mods <94934860+atravita-mods@users.noreply.github.com>2022-08-05 17:21:53 -0400
committerGitHub <noreply@github.com>2022-08-05 17:21:53 -0400
commit7a3b0e180f62e2e3094510e7e12eb64af6089560 (patch)
tree8e0b4d4b9967baac36aa447286031d6fb2e9d22a /src/SMAPI/Framework
parentab34b6142dcd04e629012a1c30d37bc9c7e5df5e (diff)
downloadSMAPI-7a3b0e180f62e2e3094510e7e12eb64af6089560.tar.gz
SMAPI-7a3b0e180f62e2e3094510e7e12eb64af6089560.tar.bz2
SMAPI-7a3b0e180f62e2e3094510e7e12eb64af6089560.zip
Adds an error message for an invaild png
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
index f3cf05d9..c825b38c 100644
--- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
@@ -254,6 +254,8 @@ namespace StardewModdingAPI.Framework.ContentManagers
{
using FileStream stream = File.OpenRead(file.FullName);
using SKBitmap bitmap = SKBitmap.Decode(stream);
+ if (bitmap is null)
+ throw new InvalidDataException("{file.FullName} appears not to be a valid image file.");
rawPixels = SKPMColor.PreMultiply(bitmap.Pixels);
width = bitmap.Width;
height = bitmap.Height;