fix remaining crash from [#27035] 3 problems: crash and enum "REGION" not found in...
[blender-staging.git] / source / blender / editors / transform / transform_generics.c
index 8c7a39e5dff3ad986b3080a6eb16fd68b4e5a410..67e04bbd34e0a968d7ec83a307043146287911ca 100644 (file)
@@ -1039,9 +1039,14 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
        else
        {
-               // XXX for now, get View2D  from the active region
-               t->view = &ar->v2d;
-               // XXX for now, the center point is the midpoint of the data
+               if(ar) {
+                       // XXX for now, get View2D  from the active region
+                       t->view = &ar->v2d;
+                       // XXX for now, the center point is the midpoint of the data
+               }
+               else {
+                       t->view= NULL;
+               }
                t->around = V3D_CENTER;
        }