fix own bug with scripts drawing, could crash when a script failed

This commit is contained in:
Campbell Barton
2008-04-04 16:32:13 +00:00
parent 5b06c03884
commit b46ef6ecb3

View File

@@ -108,14 +108,16 @@ void drawscriptspace(ScrArea *sa, void *spacedata)
}
}
if (script->py_draw) {
BPY_spacescript_do_pywin_draw(sc);
if (script) {
if (script->py_draw) {
BPY_spacescript_do_pywin_draw(sc);
} else if (!script->flags && !script->py_event && !script->py_button) {
/* quick hack for 2.37a for scripts that call the progress bar inside a
* file selector callback, to show previous space after finishing, w/o
* needing an event */
addqueue(curarea->win, MOUSEX, 0);
}
}
/* quick hack for 2.37a for scripts that call the progress bar inside a
* file selector callback, to show previous space after finishing, w/o
* needing an event */
else if (!script->flags && !script->py_event && !script->py_button)
addqueue(curarea->win, MOUSEX, 0);
}
void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt)