mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-19 14:43:47 +00:00
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.
This commit is contained in:
parent
6caafc9844
commit
3a99541541
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue