From a792f047f037bc20ef77b2a3d9360b9a4efa16d5 Mon Sep 17 00:00:00 2001 From: nukeop Date: Thu, 24 Jan 2019 10:58:12 +0100 Subject: [PATCH] Get artist related data safely --- app/components/ArtistView/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/components/ArtistView/index.js b/app/components/ArtistView/index.js index 28eaa1c576..1c82bfc931 100644 --- a/app/components/ArtistView/index.js +++ b/app/components/ArtistView/index.js @@ -1,6 +1,5 @@ import React from 'react'; import { Dimmer, Loader } from 'semantic-ui-react'; -import Spacer from '../Spacer'; import AlbumList from '../AlbumList'; import ArtistTags from './ArtistTags'; import SimilarArtists from './SimilarArtists'; @@ -8,7 +7,6 @@ import PopularTracks from './PopularTracks'; import styles from './styles.scss'; import artPlaceholder from '../../../resources/media/art_placeholder.png'; -import { artistInfoStart } from '../../actions'; class ArtistView extends React.Component { constructor(props) { @@ -18,9 +16,9 @@ class ArtistView extends React.Component { isLoading() { return ( - this.props.artist.loading || - !this.props.artist.lastfm || - this.props.artist.lastfm.loading + _.get(this.props, 'artist.loading') || + _.isEmpty(_.get(this.props, 'artist.lastfm')) || + _.get(this.props, 'artist.lastfm.loading') ); } @@ -136,7 +134,7 @@ class ArtistView extends React.Component {