Skip to content

Commit

Permalink
gracefully handle missing Item image prop
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Nov 4, 2015
1 parent d9b7b23 commit 04d55e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/views/Items/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ export default class Item extends Component {
const imageClasses = classNames(
'sd-item-image',
'ui',
this.props.image.props.className,
_.get(this.props, 'image.props.className'),
'image',
);
const imageProps = _.omit(_.get(this.props, 'image.props', {}), 'className');
const image = (
<div className={imageClasses}>
<img {..._.omit(this.props.image.props, 'className')} />
<img {...imageProps} />
</div>
);
const meta = <div className='meta'>{this.props.meta}</div>;
Expand Down

0 comments on commit 04d55e2

Please sign in to comment.