- if (p->d_name[0] == '.' && (p->d_name[1] == '\0'
- || (p->d_name[1] == '.' && p->d_name[2] == '\0')))
+ if (result == NULL)
+ break;
+ if (result->d_name[0] == '.' && (result->d_name[1] == '\0'
+ || (result->d_name[1] == '.' && result->d_name[2] == '\0')))
ret = build_dentry_tree(&child, name, lookup_table,
NULL, config, add_image_flags,
progress_func, NULL);
ret = build_dentry_tree(&child, name, lookup_table,
NULL, config, add_image_flags,
progress_func, NULL);