fix for crash when loading the file selector on startup.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 3 Oct 2011 03:48:48 +0000 (03:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 3 Oct 2011 03:48:48 +0000 (03:48 +0000)
source/blender/editors/space_file/file_ops.c

index fd52c3c41994333add022a17346cbc244ebcd1c7..c265c4ec1a73b39692cd1b2a7e4f5990a452dc8e 100644 (file)
@@ -1176,7 +1176,9 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused))
  * until this is properly supported just disable it. */
 static int file_directory_poll(bContext *C)
 {
-       return ED_operator_file_active(C) && filelist_lib(CTX_wm_space_file(C)->files) == NULL;
+       /* sfile->files can be NULL on file load */
+       SpaceFile *sfile= CTX_wm_space_file(C);
+       return ED_operator_file_active(C) && sfile->files && filelist_lib(sfile->files);
 }
 
 void FILE_OT_directory(struct wmOperatorType *ot)