[Bf-blender-cvs] [bf3fe67] master: Fix T45405: Crash on opening a file (in filebrowser code)

Julian Eisel noreply at git.blender.org
Fri Jul 10 22:10:02 CEST 2015


Commit: bf3fe67862e3a42193f45c49d3d6b07724453da7
Author: Julian Eisel
Date:   Fri Jul 10 22:04:06 2015 +0200
Branches: master
https://developer.blender.org/rBbf3fe67862e3a42193f45c49d3d6b07724453da7

Fix T45405: Crash on opening a file (in filebrowser code)

Quoting Bastien from IRC: "Filebrowser is a nest of bad surprises" -- indeed :S

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

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 6106b72..3c09800 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -157,7 +157,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
 
 	/* Text input fields for directory and file. */
 	if (available_w > 0) {
-		const struct direntry *file = filelist_file(sfile->files, params->active_file);
+		const struct direntry *file = sfile->files ? filelist_file(sfile->files, params->active_file) : NULL;
 		int overwrite_alert = file_draw_check_exists(sfile);
 		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;




More information about the Bf-blender-cvs mailing list