running scripts in background mode would crash in some cases. (tested all scripts, none segfault now)
This commit is contained in:
@@ -263,9 +263,12 @@ PyObject *LibBlockSeq_getActive(BPy_LibBlockSeq *self)
|
||||
}
|
||||
break;
|
||||
case ID_TXT: {
|
||||
SpaceText *st= curarea->spacedata.first;
|
||||
SpaceText *st = NULL;
|
||||
|
||||
if (st->spacetype!=SPACE_TEXT || st->text==NULL) {
|
||||
if (curarea)
|
||||
st = curarea->spacedata.first;
|
||||
|
||||
if (st==NULL || st->spacetype!=SPACE_TEXT || st->text==NULL) {
|
||||
Py_RETURN_NONE;
|
||||
} else {
|
||||
return Text_CreatePyObject( st->text );
|
||||
@@ -330,7 +333,14 @@ static int LibBlockSeq_setActive(BPy_LibBlockSeq *self, PyObject *value)
|
||||
return EXPP_ReturnIntError(PyExc_TypeError,
|
||||
"Must be a text" );
|
||||
} else {
|
||||
SpaceText *st= curarea->spacedata.first;
|
||||
SpaceText *st= NULL;
|
||||
|
||||
if (curarea==NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
st= curarea->spacedata.first;
|
||||
}
|
||||
|
||||
Text *data = ((BPy_Text *)value)->text;
|
||||
|
||||
if( !data )
|
||||
|
||||
Reference in New Issue
Block a user