Skip to content

Commit

Permalink
Merge pull request #35 from hillu/master
Browse files Browse the repository at this point in the history
Don't panic if AssetInfo has not been defined
  • Loading branch information
elazarl authored Feb 27, 2017
2 parents 9a6736e + f9c8800 commit 30f82fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assetfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ func (fs *AssetFS) Open(name string) (http.File, error) {
}
if b, err := fs.Asset(name); err == nil {
timestamp := defaultFileTimestamp
if info, err := fs.AssetInfo(name); err == nil {
timestamp = info.ModTime()
if fs.AssetInfo != nil {
if info, err := fs.AssetInfo(name); err == nil {
timestamp = info.ModTime()
}
}
return NewAssetFile(name, b, timestamp), nil
}
Expand Down

0 comments on commit 30f82fa

Please sign in to comment.