mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-05 04:04:38 +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
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…
Add table
Reference in a new issue