Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 18479bc

Browse filesBrowse files
authored
Merge pull request revel#1220 from notzippy/check_for_route
Checked for routes file existence before attempting to read
2 parents 20261ff + 7de5618 commit 18479bc
Copy full SHA for 18479bc

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

‎router.go

Copy file name to clipboardExpand all lines: router.go
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616

1717
"github.com/revel/pathtree"
1818
"sync"
19+
"os"
1920
)
2021

2122
const (
@@ -540,7 +541,10 @@ func getModuleRoutes(moduleName, joinedPath string, validate bool) (routes []*Ro
540541
INFO.Println("Skipping routes for inactive module", moduleName)
541542
return nil, nil
542543
}
543-
routes, err = parseRoutesFile(module, filepath.Join(module.Path, "conf", "routes"), joinedPath, validate)
544+
routePath := filepath.Join(module.Path, "conf", "routes")
545+
if _,e:=os.Stat(routePath);e == nil {
546+
routes, err = parseRoutesFile(module, routePath, joinedPath, validate)
547+
}
544548
if err == nil {
545549
for _, route := range routes {
546550
route.ModuleSource = module

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.