From 7a25ca2676846175fa81edbe4442f348e5a68c8c Mon Sep 17 00:00:00 2001 From: Human Gamer <39096122+HumanGamer@users.noreply.github.com> Date: Sat, 30 Mar 2024 17:34:25 -0500 Subject: [PATCH] Fixed crash due to error reporting --- engine/source/materials/customMaterial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/source/materials/customMaterial.cpp b/engine/source/materials/customMaterial.cpp index 92527ef7..84b37bd3 100644 --- a/engine/source/materials/customMaterial.cpp +++ b/engine/source/materials/customMaterial.cpp @@ -89,7 +89,7 @@ bool CustomMaterial::preloadTextures(Vector& errorBuffer) if (fallback != NULL) found = found && fallback->preloadTextures(errorBuffer); - bool foundVert = (!mShaderData->DXVertexShaderName || ResourceManager->find(mShaderData->getVertexShaderPath())); // Transfer shaders too lmao (attempt) + bool foundVert = (mShaderData == NULL || !mShaderData->DXVertexShaderName || ResourceManager->find(mShaderData->getVertexShaderPath())); // Transfer shaders too lmao (attempt) if (!foundVert) { //dSprintf(errorBuffer, errorBufferSize, "%s\n Could not find vertex shader: %s", errorBuffer, @@ -99,7 +99,7 @@ bool CustomMaterial::preloadTextures(Vector& errorBuffer) } found = found && foundVert; - bool foundPixel = (!mShaderData->DXPixelShaderName || ResourceManager->find(mShaderData->getPixelShaderPath())); + bool foundPixel = (mShaderData == NULL || !mShaderData->DXPixelShaderName || ResourceManager->find(mShaderData->getPixelShaderPath())); if (!foundPixel) { //dSprintf(errorBuffer, errorBufferSize, "%s\n Could not find pixel shader: %s", errorBuffer,