Clip editor: fixed crash when opening dopesheet view without having clip opened
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 May 2012 18:00:37 +0000 (18:00 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 May 2012 18:00:37 +0000 (18:00 +0000)
source/blender/editors/space_clip/space_clip.c

index 32a4a7d1f83017126c3fba7bc52d477aebd40691..1c0d2db91a90315b288f4d1156214989eec21e8d 100644 (file)
@@ -1135,7 +1135,8 @@ static void dopesheet_area_draw(const bContext *C, ARegion *ar)
        View2DScrollers *scrollers;
        short unit = 0;
 
-       BKE_tracking_dopesheet_update(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
+       if (clip)
+               BKE_tracking_dopesheet_update(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
 
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);
@@ -1194,7 +1195,8 @@ static void clip_channels_area_draw(const bContext *C, ARegion *ar)
        View2D *v2d = &ar->v2d;
        View2DScrollers *scrollers;
 
-       BKE_tracking_dopesheet_update(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
+       if (clip)
+               BKE_tracking_dopesheet_update(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
 
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);