fix [#27011] executing a script crashes Blender

This commit is contained in:
2011-04-19 04:19:09 +00:00
parent 6bdb5e75ce
commit ba229e3859

View File

@@ -964,7 +964,22 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->options |= CTX_EDGE;
}
t->spacetype = sa ? sa->spacetype : SPACE_EMPTY; /* background mode */
/* Assign the space type, some exceptions for running in different mode */
if(sa == NULL) {
/* background mode */
t->spacetype= SPACE_EMPTY;
}
else if ((ar == NULL) && (sa->spacetype == SPACE_VIEW3D)) {
/* running in the text editor */
t->spacetype= SPACE_EMPTY;
}
else {
/* normal operation */
t->spacetype= sa->spacetype;
}
if(t->spacetype == SPACE_VIEW3D)
{
View3D *v3d = sa->spacedata.first;