From 0e0eba9f79b122eeef613fbd3733b339a95094a4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 Jul 2011 05:23:36 +0000 Subject: fix for crash when setting layers or saving when there is no active scene - only really happens when running python scripts on startup. --- source/blender/windowmanager/intern/wm_files.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index e0cfb86ce05..aabaf6d4055 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -635,8 +635,9 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt) char err_out[256]= "unknown"; *thumb_pt= NULL; - - if(G.background || scene->camera==NULL) + + /* scene can be NULL if running a script at startup and calling the save operator */ + if(G.background || scene==NULL || scene->camera==NULL) return NULL; /* gets scaled to BLEN_THUMB_SIZE */ -- cgit v1.2.3