We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8424e14 commit 16e7cf6Copy full SHA for 16e7cf6
src/lib/server/api/routes/groups/misc.ts
@@ -135,13 +135,19 @@ export const misc = new Elysia()
135
});
136
const files = await Promise.all(
137
hashes.map(async (hash) => {
138
- const fileData = await downloadFile(hash, conversation._id);
139
- return fileData;
+ try {
+ const fileData = await downloadFile(hash, conversation._id);
140
+ return fileData;
141
+ } catch {
142
+ return null;
143
+ }
144
})
145
);
146
147
const filenames: string[] = [];
148
files.forEach((file) => {
149
+ if (!file) return;
150
+
151
const extension = mimeTypes.extension(file.mime) || "bin";
152
const convId = conversation._id.toString();
153
const fileId = file.name.split("-")[1].slice(0, 8);
0 commit comments