handling case when fiber.Static config is nil

pull/1130/head
Martin Lukasik 2021-01-22 23:20:12 +01:00
parent 3a132d0b98
commit d602fc76e2
1 changed files with 1 additions and 1 deletions

View File

@ -360,7 +360,7 @@ func (app *App) registerStatic(prefix, root string, config ...Static) Router {
fileHandler := fs.NewRequestHandler()
handler := func(c *Ctx) error {
// Don't execute middleware if Next returns true
if config[0].Next != nil && config[0].Next(c) {
if config != nil && config[0].Next != nil && config[0].Next(c) {
return c.Next()
}
// Serve file