|
@@ -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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|