Skip to content

Commit bd50188

Browse files
committed
consider articles with no authors
1 parent 0592f09 commit bd50188

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/components/Cards/ArticleCard.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
{/if}
2222
</div>
2323
<h2 class="font-extrabold text-xl">{title}</h2>
24-
<p class="text-sm">
25-
{#each authors as author, i }
26-
<span>{author.authors_id.name || ''}{#if i < (authors.length-1)}, {/if}</span>
27-
{/each}
28-
</p>
24+
{#if authors }
25+
<p class="text-sm">
26+
{#each authors as author, i }
27+
<span>{author.authors_id.name || ''}{#if i < (authors.length-1)}, {/if}</span>
28+
{/each}
29+
</p>
30+
{/if}
2931
<p class="text-sm text-gray-400">{date}</p>
3032
</div>
3133
</div>

0 commit comments

Comments
 (0)