diff options
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index e61d7693d19..c265c4ec1a7 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -749,7 +749,9 @@ int file_exec(bContext *C, wmOperator *exec_op) file_sfile_to_operator(op, sfile, filepath); - fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1); + if (BLI_exist(sfile->params->dir)) + fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir, 0, 1); + BLI_make_file_string(G.main->name, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu_get(), filepath); WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC); @@ -1174,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) |