Alsmile 1 年之前
父節點
當前提交
5903de2715
共有 1 個文件被更改,包括 15 次插入10 次删除
  1. 15 10
      src/services/png.ts

+ 15 - 10
src/services/png.ts

@@ -24,16 +24,21 @@ export async function getFolders(name: string, isSvg?: boolean) {
       name = temp[temp.length - 2];
     }
     const list = [];
-    for (const f of files.list) {
-      if (f.indexOf(item) >= 0) {
-        const temp = f.split('/');
-        const name = filename(temp[temp.length - 1]);
-        const elem: any = {
-          name,
-          image: cdn + '/' + f,
-          isSvg,
-        };
-        list.push(elem);
+    if (files.list) {
+      for (const f of files.list) {
+        if (f.indexOf(item) >= 0) {
+          const temp = f.split('/');
+          const name = filename(temp[temp.length - 1]);
+          if (!name) {
+            continue;
+          }
+          const elem: any = {
+            name,
+            image: cdn + '/' + f,
+            isSvg,
+          };
+          list.push(elem);
+        }
       }
     }