diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-03-22 01:16:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-03-22 01:16:41 +0300 |
commit | 9cf9ce75af91b4d28bec0b94f44aa0557d7c2342 (patch) | |
tree | 9172c052ebcb8c2f4bdf5acb98d0a7b9872c0051 /source/blender/python/api2_2x/Sys.c | |
parent | 8383c44a8547468b2ce24c64c162f02942126703 (diff) |
Fix for bug,
https://projects.blender.org/tracker/index.php?func=detail&aid=4021&group_id=9&atid=125
Raise an error instead of crash when python expandpath runs and no scene is loaded.
Diffstat (limited to 'source/blender/python/api2_2x/Sys.c')
-rw-r--r-- | source/blender/python/api2_2x/Sys.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Sys.c b/source/blender/python/api2_2x/Sys.c index eb5b512323e..b333952a4d0 100644 --- a/source/blender/python/api2_2x/Sys.c +++ b/source/blender/python/api2_2x/Sys.c @@ -414,7 +414,10 @@ static PyObject *M_sys_expandpath( PyObject * self, PyObject * args ) if (!PyArg_ParseTuple( args, "s", &path)) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected string argument" ); - + if (!G.scene) + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "error, load a blend before expending the path." ) + BLI_strncpy(expanded, path, FILE_MAXDIR + FILE_MAXFILE); BLI_convertstringcode(expanded, G.sce, G.scene->r.cfra); |