mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
filter out nulls from map
This commit is contained in:
parent
706cfc5400
commit
c7a1e33641
@ -123,12 +123,16 @@ const FileGrid = ({
|
||||
h="30rem"
|
||||
style={{ overflowY: "auto", width: "100%" }}
|
||||
>
|
||||
{displayFiles.map((item, idx) => {
|
||||
if (!item.record?.id) {
|
||||
console.error('FileGrid: File missing WorkbenchFile with proper ID:', item.file.name);
|
||||
return null;
|
||||
}
|
||||
const fileId = item.record.id;
|
||||
{displayFiles
|
||||
.filter(item => {
|
||||
if (!item.record?.id) {
|
||||
console.error('FileGrid: File missing WorkbenchFile with proper ID:', item.file.name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.map((item, idx) => {
|
||||
const fileId = item.record!.id; // Safe to assert after filter
|
||||
const originalIdx = files.findIndex(f => f.record?.id === fileId);
|
||||
const supported = isFileSupported ? isFileSupported(item.file.name) : true;
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user