Fix null references
This commit is contained in:
parent
5830d3b1bb
commit
f53664a694
|
@ -81,19 +81,17 @@
|
|||
bind:this={anchor}
|
||||
>
|
||||
{#each value || [] as attachment}
|
||||
{#if attachment}
|
||||
{#if isImage(attachment.extension)}
|
||||
<img
|
||||
class:light={!$props?.darkMode &&
|
||||
schema.type === FieldType.SIGNATURE_SINGLE}
|
||||
src={attachment.url}
|
||||
alt={attachment.extension}
|
||||
/>
|
||||
{:else}
|
||||
<div class="file" title={attachment.name}>
|
||||
{attachment.extension}
|
||||
</div>
|
||||
{/if}
|
||||
{#if isImage(attachment.extension)}
|
||||
<img
|
||||
class:light={!$props?.darkMode &&
|
||||
schema.type === FieldType.SIGNATURE_SINGLE}
|
||||
src={attachment.url}
|
||||
alt={attachment.extension}
|
||||
/>
|
||||
{:else}
|
||||
<div class="file" title={attachment.name}>
|
||||
{attachment.extension}
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
|
|
|
@ -82,7 +82,9 @@ export function getRelatedTableValues(row, field, fromField) {
|
|||
const parser = columnTypeManyParser[field.type] || (value => value)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue