forked from bartvdbraak/blender
Bug #3658 reported by Daniel Holtz (thanks):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=3658&group_id=9 Running scripts from command line in bg mode: blender -b -P myscript.py crashes Blender 2.40. The problem is in add_text() in text.c: G.scene can be NULL at this point (in bg mode). Added a check: line 323: if (G.scene) /* can be NULL (bg mode) */ BLI_convertstringcode(str, G.sce, G.scene->r.cfra); The text being added with add_text() in this particular case is the script filename specified at the command prompt, so it should be ok to skip BLI_convertstringcode. Feel free to disagree, though.
This commit is contained in:
parent
37495aa211
commit
b1c6fe7337
@ -320,6 +320,7 @@ Text *add_text(char *file)
|
||||
char str[FILE_MAXDIR+FILE_MAXFILE];
|
||||
|
||||
BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE);
|
||||
if (G.scene) /* can be NULL (bg mode) */
|
||||
BLI_convertstringcode(str, G.sce, G.scene->r.cfra);
|
||||
BLI_split_dirfile(str, sdir, sfile);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user