fix for a crash with the following steps.
[blender-staging.git] / source / blender / editors / screen / screen_edit.c
index a0a2ede11ef28ce12efa7b8c2f2324f2ece79227..e942cfc8b1fcd38702e78a1749e9eeb310e0212d 100644 (file)
@@ -1133,7 +1133,10 @@ void ED_area_exit(bContext *C, ScrArea *sa)
        ARegion *ar;
 
        if (sa->spacetype == SPACE_FILE) {
-               ED_fileselect_exit(C, (SpaceFile*)(sa) ? sa->spacedata.first : CTX_wm_space_data(C));
+               SpaceLink *sl= sa->spacedata.first;
+               if(sl && sl->spacetype == SPACE_FILE) {
+                       ED_fileselect_exit(C, (SpaceFile *)sl);
+               }
        }
 
        CTX_wm_area_set(C, sa);