From d8e2e924286c936d244d0ca13d84fe7c43cb0f09 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Tue, 13 Jun 2023 19:47:14 -0700 Subject: [PATCH] use get --- dGame/Entity.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 1f007746..96b89e53 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -786,6 +786,7 @@ void Entity::UpdateXMLDoc(tinyxml2::XMLDocument* doc) { CppScripts::Script* Entity::GetScript() const { auto* scriptComponent = GetComponent(); + if (!scriptComponent) return CppScripts::invalidScript.get(); auto* script = scriptComponent->GetScript(); DluAssert(script != nullptr); return script;