Fix for NullReferenceException: Object reference not set to an instance of an object

This commit is contained in:
Marllon Vilano 2024-02-19 13:39:04 -03:00
parent 75a1003b8c
commit 41e493b7c3

View File

@ -194,7 +194,13 @@ namespace Spine.Unity {
loadedDataAtMaterial = new MaterialOnDemandData[placeholderMap.Length];
for (int i = 0, count = loadedDataAtMaterial.Length; i < count; ++i) {
loadedDataAtMaterial[i].lastFrameRequested = -1;
int texturesAtMaterial = placeholderMap[i].textures.Length;
var textures = placeholderMap[i].textures;
if (textures == null) {
continue;
}
int texturesAtMaterial = textures.Length;
loadedDataAtMaterial[i].textureRequests = new TextureRequest[texturesAtMaterial];
}
}