[Bf-blender-cvs] [9a3dfa1] master: Fix crash when appending from File Browser

Julian Eisel noreply at git.blender.org
Fri Jul 10 17:50:16 CEST 2015


Commit: 9a3dfa1f21168c19a3346bb4813b1313deb6fb18
Author: Julian Eisel
Date:   Fri Jul 10 17:48:49 2015 +0200
Branches: master
https://developer.blender.org/rB9a3dfa1f21168c19a3346bb4813b1313deb6fb18

Fix crash when appending from File Browser

Again own mistake in rBaeeb23efa28dc1

===================================================================

M	source/blender/editors/space_file/file_draw.c

===================================================================

diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 028705a..6106b72 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"),




More information about the Bf-blender-cvs mailing list