Prevent trying to tint null image

This commit is contained in:
Nick 2022-05-23 02:35:32 -04:00
parent 5b8bb29dcc
commit ed49e8b6af

View File

@ -1,4 +1,4 @@
using OWML.Common;
using OWML.Common;
using System;
using System.Collections.Generic;
using System.IO;
@ -194,6 +194,12 @@ namespace NewHorizons.Utility
public static Texture2D TintImage(Texture2D image, Color tint)
{
if(image == null)
{
Logger.LogError($"Tried to tint null image");
return null;
}
var pixels = image.GetPixels();
for (int i = 0; i < pixels.Length; i++)
{