From 60d02f1f81bf64762617a6e8b25a9a694b482704 Mon Sep 17 00:00:00 2001 From: Recrown Date: Tue, 29 Jan 2019 15:58:20 -0600 Subject: [PATCH] Skin will now return null if the skin doesn't contain a texture region a definition potentially requests. If request name is null, will now also return null. --- RecrownedAthenaeum/UI/SkinSystem/Skin.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RecrownedAthenaeum/UI/SkinSystem/Skin.cs b/RecrownedAthenaeum/UI/SkinSystem/Skin.cs index 10cb13b..af27331 100644 --- a/RecrownedAthenaeum/UI/SkinSystem/Skin.cs +++ b/RecrownedAthenaeum/UI/SkinSystem/Skin.cs @@ -47,9 +47,10 @@ namespace RecrownedAthenaeum.UI.SkinSystem /// Returns a with given name of region. /// /// Name of region. - /// The region corresponding to the name. + /// The region corresponding to the name or null if the requested region doesn't exist. public virtual TextureAtlas.Region GetTextureAtlasRegion(string name) { + if (!textureAtlas.ContainsRegion(name)) return null; return textureAtlas[name]; }