-
Notifications
You must be signed in to change notification settings - Fork 353
Fix crash when adding a Light via Component Inspector Editor
#3137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: momo <[email protected]>
Light via Component Inspector Editor
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
| sdf::Visual visual; | ||
| visual.SetName(_name->Data()); | ||
| visual.SetRawPose(_pose->Data()); | ||
| if(!_geom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this check can be moved to the start of the function, i.e. before sdf::Visual visual
|
Sorry , I do some tests after this fix , but when I rerun the simulation after I add a |

🦟 Bug fix
Fixes #3131
Summary
When adding a
lightviaComponent Inspector Editor, the created entity ends up with aVisualcomponent but no validGeometry.RenderUtil::CreateVisualassumesGeometryis present and callsvisual.SetGeom(_geom->Data()), causing a crash.This fix
returnearly when_geomisnullptr, avoiding thecrashinSetGeom, while not affectinglightcreationChecklist
codecheckpassed (See contributing)