Show "no owner" when challenge leader cannot be found

Fixes #11768

- Check if `challenge.leader` is `null` before trying to display the user's name after "Created By:"
- Check the `challenge.leader` isn't `null` before trying to get its `id` for comparison when determining if the current user `canDelete` or `canEdit`
This commit is contained in:
Tom Thorpe
2020-02-01 09:17:59 +00:00
parent c772afd0c8
commit 311df85dfc
3 changed files with 15 additions and 3 deletions

View File

@@ -43,7 +43,14 @@
>
<div class="owner-item">
<strong>{{ $t('createdBy') }}:</strong>
<span
v-if="challenge.leader === null"
class="mx-1"
>
{{ $t('noChallengeOwner') }}
</span>
<user-link
v-else
class="mx-1"
:user="challenge.leader"
/>