Fix #457: Fixed crash on artist pages when no cover is available

This commit is contained in:
Eliot Berriot 2018-07-27 19:05:10 +02:00
parent 75852e537a
commit c53f03c4a5
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
2 changed files with 5 additions and 4 deletions

View File

@ -0,0 +1 @@
Fixed crash on artist pages when no cover is available (#457)

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="isLoading" class="ui vertical segment" v-title="labels.title">
<div v-title="labels.title">
<div v-if="isLoading" class="ui vertical segment">
<div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div>
</div>
<template v-if="artist">
@ -102,7 +102,7 @@ export default {
self.artist = response.data
self.isLoading = false
self.isLoadingAlbums = true
axios.get('albums/', {params: {artist: this.id, ordering: '-release_date'}}).then((response) => {
axios.get('albums/', {params: {artist: self.id, ordering: '-release_date'}}).then((response) => {
let parsed = JSON.parse(JSON.stringify(response.data.results))
self.albums = parsed.map((album) => {
return backend.Album.clean(album)
@ -158,7 +158,7 @@ export default {
})[0]
},
headerStyle () {
if (!this.cover.original) {
if (!this.cover || !this.cover.original) {
return ''
}
return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.cover.original) + ')'