extract.c: check for empty extraction list
[wimlib] / src / extract.c
index 9d65bef8f5c2443e6928b95caa0e19ebf7ae5c28..c61dac764dfc612e36872c099100ca0c643af58f 100644 (file)
@@ -1473,6 +1473,11 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
        if (ret)
                goto out_cleanup;
 
+       if (unlikely(list_empty(&dentry_list))) {
+               WARNING("There is nothing to extract!");
+               goto out_cleanup;
+       }
+
        ret = dentry_list_resolve_streams(&dentry_list, ctx);
        if (ret)
                goto out_cleanup;