diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-07-10 18:48:49 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-07-10 18:49:58 +0300 |
commit | 9a3dfa1f21168c19a3346bb4813b1313deb6fb18 (patch) | |
tree | e206b9e18ab675be4ba0e2689a1413c51a8020aa /source/blender | |
parent | e7a48113a96f958c19ed630d8490930637480c81 (diff) |
Fix crash when appending from File Browser
Again own mistake in rBaeeb23efa28dc1
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 028705a7529..6106b723e99 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -159,7 +159,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) if (available_w > 0) { const struct direntry *file = filelist_file(sfile->files, params->active_file); int overwrite_alert = file_draw_check_exists(sfile); - const bool is_active_dir = file && BLI_is_dir(file->path); + const bool is_active_dir = file && file->path && BLI_is_dir(file->path); char *dir_path = (is_active_dir && params->active_file > 0) ? file->path : params->dir; BLI_add_slash(dir_path); @@ -224,9 +224,10 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Execute / cancel buttons. */ if (loadbutton) { const struct direntry *file = filelist_file(sfile->files, params->active_file); - const char *str_exec = (file && BLI_is_dir(file->path)) ? IFACE_("Open Directory") : params->title; + const char *str_exec = (file && file->path && BLI_is_dir(file->path)) ? + /* params->title is already translated! */ + IFACE_("Open Directory") : params->title; - /* params->title is already translated! */ uiDefButO(block, UI_BTYPE_BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, str_exec, max_x - loadbutton, line1_y, loadbutton, btn_h, ""); uiDefButO(block, UI_BTYPE_BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, IFACE_("Cancel"), |