fix crash when report timer was set but no usable error reports were found.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 2 Dec 2010 21:40:39 +0000 (21:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 2 Dec 2010 21:40:39 +0000 (21:40 +0000)
source/blender/editors/space_info/info_ops.c

index 7eb7cc55bc17d683fd8e28c6bbc50303a035098d..6ffbf1455e45814a97d3ead30326c56219cee940 100644 (file)
@@ -326,10 +326,13 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
        int send_note= 0;
        
        /* escape if not our timer */
-       if(reports->reporttimer==NULL || reports->reporttimer != event->customdata)
+       if(             (reports->reporttimer==NULL) ||
+                       (reports->reporttimer != event->customdata) ||
+                       ((report= BKE_reports_last_displayable(reports))==NULL) /* may have been deleted */
+       ) {
                return OPERATOR_PASS_THROUGH;
+       }
 
-       report= BKE_reports_last_displayable(reports);
        rti = (ReportTimerInfo *)reports->reporttimer->customdata;
        
        timeout = (report->type & RPT_ERROR_ALL)?ERROR_TIMEOUT:INFO_TIMEOUT;