[8559] Python script that uses FIleSelector and has an error in it segfaults Blender

Want completely fixed, check if the script was removed before running the callback.
This commit is contained in:
Campbell Barton 2008-03-16 14:28:00 +00:00
parent bead422c1f
commit 26daad49a3

@ -513,6 +513,14 @@ static void getSelectedFile( char *name )
script = sc->script; script = sc->script;
} }
} }
/* If 'script' is null,
* The script must have had an error and closed,
* but the fileselector was left open, show an error and exit */
if (!script) {
error("Python script error: script quit, cannot run callback");
return;
}
pycallback = script->py_browsercallback; pycallback = script->py_browsercallback;