Fix null references

This commit is contained in:
Adria Navarro 2024-09-26 13:59:42 +02:00
parent 5830d3b1bb
commit f53664a694
2 changed files with 14 additions and 14 deletions

View File

@ -81,7 +81,6 @@
bind:this={anchor} bind:this={anchor}
> >
{#each value || [] as attachment} {#each value || [] as attachment}
{#if attachment}
{#if isImage(attachment.extension)} {#if isImage(attachment.extension)}
<img <img
class:light={!$props?.darkMode && class:light={!$props?.darkMode &&
@ -94,7 +93,6 @@
{attachment.extension} {attachment.extension}
</div> </div>
{/if} {/if}
{/if}
{/each} {/each}
</div> </div>

View File

@ -82,7 +82,9 @@ export function getRelatedTableValues(row, field, fromField) {
const parser = columnTypeManyParser[field.type] || (value => value) const parser = columnTypeManyParser[field.type] || (value => value)
result = parser( result = parser(
row[field.related.field].flatMap(r => r[field.related.subField]), row[field.related.field]
.flatMap(r => r[field.related.subField])
.filter(i => i !== undefined && i !== null),
field field
) )