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

@@ -18,7 +18,10 @@
<div>
<span class="mr-1 ml-0 d-block">
<strong v-once>{{ $t('createdBy') }}:</strong>
<user-link
<span v-if="challenge.leader === null">
{{ $t('noChallengeOwner') }}
</span>
<user-link v-else
class="mx-1"
:user="challenge.leader"
/>