FnCreateRope: Protect against null or non-definition graphics proplist

rope
Armin Burgmeier 2012-04-29 00:44:58 +02:00
parent 89c63b393b
commit eacc4d6917
1 changed files with 5 additions and 1 deletions

View File

@ -2129,7 +2129,11 @@ static C4PropList* FnCreateRope(C4AulContext *cthr, C4Object* First, C4Object* S
{
try
{
return Game.Ropes.CreateRope(First, Second, iSegments, &Graphics->GetDef()->Graphics);
if(!Graphics) return false;
C4Def* Def = Graphics->GetDef();
if(!Def) return false;
return Game.Ropes.CreateRope(First, Second, iSegments, &Def->Graphics);
}
catch(const C4RopeError& err)
{