Fix #54468: crash calling transform operators with incomplete regiondata #119205
|
@ -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
|
||||
|
||||
* set to 'VIEW_3D' but the viewport was not updated. */
|
||||
t->spacetype = SPACE_EMPTY;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue
I think we could take advantage and improve the comment here to something like:
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.