Skip to content

Commit

Permalink
adding err check
Browse files Browse the repository at this point in the history
  • Loading branch information
cesrjimenez committed Aug 18, 2023
1 parent d348146 commit 9c9b762
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions site.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ func (s *Site) GetResources(dir, version string) (http.FileSystem, error) {
c, err := s.Content.OpenVersion(context.Background(), version)
if err != nil {
// if template dir doesn't exist, use the default one from main
c, err = s.Content.OpenVersion(context.Background(), "")
if err != nil {
return nil, err
if errors.Is(err, os.ErrNotExist) {
c, err = s.Content.OpenVersion(context.Background(), "")
if err != nil {
return nil, err
}
}
}
return &subdirFileSystem{fs: c, path: "_resources/" + dir}, nil
Expand Down

0 comments on commit 9c9b762

Please sign in to comment.