2.5 filebrowser
[blender.git] / source / blender / editors / space_file / filelist.c
index 2ab43e59e6678a76ac411a8f82e89fd9f2318095..2a2aa610f9612117cb56daece8036c65c913806d 100644 (file)
@@ -692,8 +692,10 @@ void filelist_readdir(struct FileList* filelist)
        for (i=0; (i < filelist->numfiles); ++i)
        {
                struct direntry* file = filelist_file(filelist, i);     
-               int len = UI_GetStringWidth(G.font, file->relname,0)+UI_GetStringWidth(G.font, file->size,0);
-               if (len > filelist->maxnamelen) filelist->maxnamelen = len;
+               if (file) {
+                       int len = UI_GetStringWidth(G.font, file->relname,0)+UI_GetStringWidth(G.font, file->size,0);
+                       if (len > filelist->maxnamelen) filelist->maxnamelen = len;
+               }
        }
 }