NULL pointer check to prevent some crash in background mode

This commit is contained in:
Martin Poirier 2009-11-10 20:34:35 +00:00
parent 0797054c2d
commit 84e3b2d726
1 changed files with 1 additions and 1 deletions

View 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)