Added error prints if the text's main is not set.

This commit is contained in:
Campbell Barton 2009-07-20 11:30:27 +00:00
parent ae7e321c8b
commit 8bf9a8cb1e

@ -66,7 +66,10 @@ PyObject *bpy_text_import( char *name, int *found )
*found= 0;
if(!maggie) return NULL;
if(!maggie) {
printf("ERROR: bpy_import_main_set() was not called before running python. this is a bug.\n");
return NULL;
}
if (namelen>21-3) return NULL; /* we know this cant be importable, the name is too long for blender! */
@ -114,6 +117,11 @@ PyObject *bpy_text_reimport( PyObject *module, int *found )
//XXX Main *maggie= bpy_import_main ? bpy_import_main:G.main;
Main *maggie= bpy_import_main;
if(!maggie) {
printf("ERROR: bpy_import_main_set() was not called before running python. this is a bug.\n");
return NULL;
}
*found= 0;
/* get name, filename from the module itself */