mirror of https://github.com/gofiber/fiber.git
handling case when fiber.Static config is nil
parent
3a132d0b98
commit
d602fc76e2
|
@ -360,7 +360,7 @@ func (app *App) registerStatic(prefix, root string, config ...Static) Router {
|
||||||
fileHandler := fs.NewRequestHandler()
|
fileHandler := fs.NewRequestHandler()
|
||||||
handler := func(c *Ctx) error {
|
handler := func(c *Ctx) error {
|
||||||
// Don't execute middleware if Next returns true
|
// 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()
|
return c.Next()
|
||||||
}
|
}
|
||||||
// Serve file
|
// Serve file
|
||||||
|
|
Loading…
Reference in New Issue