diff --git a/File_Format_Library/FileFormats/Layout/Common.cs b/File_Format_Library/FileFormats/Layout/Common.cs index 7a3f0865..1bc32189 100644 --- a/File_Format_Library/FileFormats/Layout/Common.cs +++ b/File_Format_Library/FileFormats/Layout/Common.cs @@ -1842,9 +1842,10 @@ namespace LayoutBXLYT if (TextureMaps[i].Name == name) removeIndex = i; } + if (removeIndex != -1) { - TextureMaps.RemoveAt(removeIndex); + TextureMaps = TextureMaps.RemoveAt(removeIndex); return true; }