NULL pointer check to prevent some crash in background mode
authorMartin Poirier <theeth@yahoo.com>
Tue, 10 Nov 2009 20:34:35 +0000 (20:34 +0000)
committerMartin Poirier <theeth@yahoo.com>
Tue, 10 Nov 2009 20:34:35 +0000 (20:34 +0000)
source/blender/editors/space_view3d/space_view3d.c

index 5bde6e029e4e60e4ead0d8aa43964b15bc021cc1..453f16239fe6af492a546408b7f5a461b89b06ac 100644 (file)
@@ -148,7 +148,7 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C)
        
        if(rv3d==NULL) {
                ScrArea *sa =CTX_wm_area(C);
-               if(sa->spacetype==SPACE_VIEW3D) {
+               if(sa && sa->spacetype==SPACE_VIEW3D) {
                        ARegion *ar;
                        for(ar= sa->regionbase.first; ar; ar= ar->next)
                                if(ar->regiontype==RGN_TYPE_WINDOW)