fix for crash with the job system progress bar on load, matt you may want to check...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 7 Jun 2010 14:54:42 +0000 (14:54 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 7 Jun 2010 14:54:42 +0000 (14:54 +0000)
source/blender/windowmanager/intern/wm_jobs.c

index e7df703ba793b807daa470213e7f5ff2733e1c58..c3ad8f96cb081129c6ef6ea081d57231f781d631 100644 (file)
@@ -449,12 +449,15 @@ void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
                }
        }
        
-       /* if there are running jobs, set the global progress indicator */
-       if (jobs_progress > 0) {
-               float progress = total_progress / (float)jobs_progress;
-               WM_progress_set(wm->winactive, progress);
-       } else {
-               WM_progress_clear(wm->winactive);
+       /* on file load 'winactive' can be NULL, possibly it should not happen but for now do a NULL check - campbell */
+       if(wm->winactive) {
+               /* if there are running jobs, set the global progress indicator */
+               if (jobs_progress > 0) {
+                       float progress = total_progress / (float)jobs_progress;
+                       WM_progress_set(wm->winactive, progress);
+               } else {
+                       WM_progress_clear(wm->winactive);
+               }
        }
 }