fix(RetinaImg): shoudn't throw an exception if you forget to provide an image name

This commit is contained in:
Ben Gotow 2015-06-05 18:28:06 -07:00
parent 5904381338
commit 54b9f2bfb6

View file

@ -125,6 +125,8 @@ class RetinaImg extends React.Component
<img className={className} src={path} style={style} {...otherProps} />
_pathFor: (name) ->
return null unless name and _.isString(name)
[basename, ext] = name.split('.')
if @props.active is true
name = "#{basename}-active.#{ext}"