mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
📂 fix: Prevent Null Reference Errors in File Process (#8084)
This commit is contained in:
parent
799f0e5810
commit
9cdc62b655
2 changed files with 214 additions and 2 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue