Skip to content

Commit

Permalink
[Collision] Secure pointers dereferences (#4819)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger authored Jul 11, 2024
1 parent 3bfaa78 commit 93933a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ class SphereCollisionModel : public core::CollisionModel

context->addObject(obj);
}
else
{
obj = sofa::core::objectmodel::New<T>();
}

if (arg) obj->parse(arg);
if (arg && obj) obj->parse(arg);

return obj;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API ContactListener : public vir
std::string collModelPath1;
std::string collModelPath2;

if(arg)
if(arg && context)
{
collModelPath1 = arg->getAttribute(std::string("collisionModel1"), "" );
collModelPath2 = arg->getAttribute(std::string("collisionModel2"), "" );
Expand Down

0 comments on commit 93933a5

Please sign in to comment.