Commit 0c3406ff authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

LandingGadget: Fix Case when there is only one file in the zip

parent 6bd580b7
......@@ -12,13 +12,13 @@
zip.forEach(function (relativePath, zipEntry) {
path_list.push(relativePath);
});
if (path_list) {
if (path_list && path_list.length > 1) {
root_path = path_list[0].split("/")[0];
}
for (i = 0; i < path_list.length - 1; i++) {
if (root_path !== path_list[i].split("/")[0]) {
root_path = "";
break;
for (i = 0; i < path_list.length - 1; i++) {
if (root_path !== path_list[i].split("/")[0]) {
root_path = "";
break;
}
}
}
if (root_path !== "" && !from_path) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment