mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(RetinaImg): shoudn't throw an exception if you forget to provide an image name
This commit is contained in:
parent
5904381338
commit
54b9f2bfb6
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue