mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 18:23:21 +08:00
fix(RetinaImg): shoudn't throw an exception if you forget to provide an image name
This commit is contained in:
parent
af5e2ea1dd
commit
c6880ab42b
1 changed files with 2 additions and 0 deletions
|
@ -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