fix [#29734] Crash after bpy.ops.file.direrectory_new()
authorCampbell Barton <ideasman42@gmail.com>
Sat, 31 Dec 2011 03:52:07 +0000 (03:52 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 31 Dec 2011 03:52:07 +0000 (03:52 +0000)
source/blender/editors/space_file/filesel.c

index 65473bde0d1c2e70b6d2976145c3e733d9027aa2..1d629ad6dea9ec4ea2e4868798c06cee14d17590 100644 (file)
@@ -667,9 +667,13 @@ void autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v))
 
 void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile)
 {
-       thumbnails_stop(sfile->files, C);
-       filelist_freelib(sfile->files);
-       filelist_free(sfile->files);
+       /* only NULL in rare cases - [#29734] */
+       if (sfile->files) {
+               thumbnails_stop(sfile->files, C);
+               filelist_freelib(sfile->files);
+               filelist_free(sfile->files);
+       }
+
        sfile->params->active_file = -1;
        WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
 }