Fix T37907: Crash when change screen layout to "Motion Tracking"
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 21 Dec 2013 14:26:23 +0000 (20:26 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 21 Dec 2013 14:26:23 +0000 (20:26 +0600)
Was a bug in recent change from my own.

Also fixed cache line being displayed twice.

source/blender/editors/space_clip/clip_draw.c

index c029ced5688fdafe65db4231821c29fa8cfc6abb..983858ac56890df5f34b6842f8ba3099034289b6 100644 (file)
@@ -1795,17 +1795,16 @@ void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *ar)
                draw_tracking_tracks(sc, scene, ar, clip, width, height, zoomx, zoomy);
                draw_distortion(sc, ar, clip, width, height, zoomx, zoomy);
        }
-
-       draw_movieclip_cache(sc, ar, clip, scene);
-       draw_movieclip_notes(sc, ar);
 }
 
 void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *ar)
 {
        Scene *scene = CTX_data_scene(C);
        MovieClip *clip = ED_space_clip_get_clip(sc);
-       draw_movieclip_cache(sc, ar, clip, scene);
-       draw_movieclip_notes(sc, ar);
+       if (clip) {
+               draw_movieclip_cache(sc, ar, clip, scene);
+               draw_movieclip_notes(sc, ar);
+       }
 }
 
 /* draw grease pencil */