2.5
authorTon Roosendaal <ton@blender.org>
Tue, 17 Feb 2009 16:33:08 +0000 (16:33 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 17 Feb 2009 16:33:08 +0000 (16:33 +0000)
Bug: cleanup in space_file copy I did missed a NULL check :)

source/blender/editors/space_file/space_file.c

index c73c6e7b6a958bf0d62a0aa13d1ee9dfd14241a3..48f501f0173789607bd2811235dc711c442cd7be 100644 (file)
@@ -142,12 +142,14 @@ static SpaceLink *file_duplicate(SpaceLink *sl)
        /* clear or remove stuff from old */
        sfilen->op = NULL; /* file window doesn't own operators */
 
-       sfilen->params= MEM_dupallocN(sfileo->params);
-       
        sfilen->files = filelist_new();
-       filelist_setdir(sfilen->files, sfilen->params->dir);
-       filelist_settype(sfilen->files, sfilen->params->type);
-
+       
+       if(sfileo->params) {
+               sfilen->params= MEM_dupallocN(sfileo->params);
+       
+               filelist_setdir(sfilen->files, sfilen->params->dir);
+               filelist_settype(sfilen->files, sfilen->params->type);
+       }
        return (SpaceLink *)sfilen;
 }