-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
DXF export: fix crash on some MultiPolygon geometries when offset != 0 (fixes #46245) #47277
Conversation
Q_ASSERT( polygon ); | ||
const QgsGeometryCollection *gc = dynamic_cast<const QgsGeometryCollection *>( sourceGeom ); | ||
Q_ASSERT( gc ); | ||
if ( gc ) |
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.
So ... now I'm wondering if we need this check at all, at this point we should be sure we have a gc
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.
at this point we should be sure we have a gc
I think so, but can't swear :-) The current code should be safe enough: not crashing in production builds, and asserting in debug builds so we can investigate what's going on
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.
Makes sense. I always lived by the rule after an assert ub is allowed in prod. But not sure that's a common understanding 🤪
for ( int i = 0; i < gc->numGeometries(); i++ ) | ||
const QgsGeometryCollection *gc = dynamic_cast<const QgsGeometryCollection *>( sourceGeom ); | ||
Q_ASSERT( gc ); | ||
if ( gc ) |
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.
Same remark, the if
after the assert
only makes sense if this is realistic to happen because of some uncontrollable conditions with release builds
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.
Thanks
No description provided.