From 3a995415414c1d07ea7e894aac27838a7e194b7b Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 9 May 2016 13:43:06 -0500 Subject: [PATCH] Select camera when in material editor crashfix. When attempting to select a camera Object(so going into the editor, going into the freefloating camera and then back to the player camera and selecting the freefloating one) while the material editor was open, it would crash because it attempts to access the shapebase object's shapeInstance - but cameras don't have a shape. This fixes it so it makes sure there's a shapeinstance before trying to get the material data. --- Engine/source/T3D/shapeBase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 52ea070e3..e8e067465 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -4888,7 +4888,8 @@ DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, if ((ShapeBase*)obj->getClientObject()) obj = (ShapeBase*)obj->getClientObject(); - return obj->getShapeInstance()->getTargetCount(); + if (obj->getShapeInstance() != NULL) + return obj->getShapeInstance()->getTargetCount(); } return -1;