Skip to content

Commit

Permalink
Get artist related data safely
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Jan 24, 2019
1 parent 8503f77 commit a792f04
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/components/ArtistView/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
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';
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) {
Expand All @@ -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')
);
}

Expand Down Expand Up @@ -136,7 +134,7 @@ class ArtistView extends React.Component {
</div>
<hr />
<AlbumList
albums={artist.releases}
albums={_.get(artist, 'releases')}
albumInfoSearch={albumInfoSearch}
history={history}
/>
Expand Down

0 comments on commit a792f04

Please sign in to comment.