Fix #54468: crash calling transform operators with incomplete regiondata #119205

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:54468 into blender-v4.1-release 2024-03-11 09:27:42 +01:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit bf162bdf1c - Show all commits

View File

@ -242,7 +242,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
else if (((region == nullptr) || (region->regiondata == nullptr)) &&
(area->spacetype == SPACE_VIEW3D))
{
/* running in the text editor */
/* Running the operator through the text editor where e.g. `area.type` was

I think we could take advantage and improve the comment here to something like:

/* Running the operator through the text editor where `area.type` was set to 'VIEW_3D' but the viewport was not updated. */

I wonder how the previous condition was triggered... When the region is nullptr? Maybe it's worth including in the comment too.

And, just to make it clearer that the problem is when setting VIEW_3D, it may be interesting to put (area->spacetype == SPACE_VIEW3D) before.

In any case, LGTM.

I think we could take advantage and improve the comment here to something like: ``` /* Running the operator through the text editor where `area.type` was set to 'VIEW_3D' but the viewport was not updated. */ ``` I wonder how the previous condition was triggered... When the region is nullptr? Maybe it's worth including in the comment too. And, just to make it clearer that the problem is when setting `VIEW_3D`, it may be interesting to put `(area->spacetype == SPACE_VIEW3D)` before. In any case, LGTM.
* set to 'VIEW_3D' but the viewport was not updated. */
t->spacetype = SPACE_EMPTY;
}
else {