[#18654] different behaviour if script is called from (1) Menu (2) TextEditor (3) ScriptsWindow [including crash!]

bugfix, simple NULL check
This commit is contained in:
Campbell Barton 2009-05-01 14:19:56 +00:00
parent bb3fa18a95
commit 742ddade12

@ -915,12 +915,12 @@ static PyObject *Method_Exit( PyObject * self )
exit_pydraw( sc, 0 );
script = sc->script;
if(script) { /* in very rare cases this can be NULL, (when saving and loading see bug #18654)*/
/* remove our lock to the current namespace */
script->flags &= ~SCRIPT_GUI;
script->scriptname[0] = '\0';
script->scriptarg[0] = '\0';
}
Py_RETURN_NONE;
}