Skip to content
Snippets Groups Projects
Verified Commit 20ef2925 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

fix potential panic crash

parent 1aabe320
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,11 @@ func getIDlogger(id string) log.Ext1FieldLogger {
// GetRequestLogger returns a logrus.Ext1FieldLogger that always includes a request's id
func GetRequestLogger(ctx *fiber.Ctx) log.Ext1FieldLogger {
return getIDlogger(ctx.Locals("requestid").(string))
rid := ctx.Locals("requestid")
if rid != nil {
return getIDlogger(rid.(string))
}
return getIDlogger("")
}
// GetSSHRequestLogger returns a logrus.Ext1FieldLogger that always includes an ssh request's id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment