📂 fix: Prevent Null Reference Errors in File Process (#8084)

This commit is contained in:
Sebastien Bruel 2025-06-27 07:51:35 +09:00 committed by GitHub
parent 799f0e5810
commit 9cdc62b655
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 214 additions and 2 deletions

View file

@ -55,7 +55,9 @@ const processFiles = async (files, fileIds) => {
}
if (!fileIds) {
return await Promise.all(promises);
const results = await Promise.all(promises);
// Filter out null results from failed updateFileUsage calls
return results.filter((result) => result != null);
}
for (let file_id of fileIds) {
@ -67,7 +69,9 @@ const processFiles = async (files, fileIds) => {
}
// TODO: calculate token cost when image is first uploaded
return await Promise.all(promises);
const results = await Promise.all(promises);
// Filter out null results from failed updateFileUsage calls
return results.filter((result) => result != null);
};
/**