fix: check if flash field exists
This commit is contained in:
parent
fbc6c9ca20
commit
dd952a1f39
|
|
@ -18,7 +18,11 @@ func (s *Session) FlashGet() any {
|
|||
}
|
||||
|
||||
func (s *Session) FlashPeek() any {
|
||||
list, _ := s.inner.Values["_flash"].([]any)
|
||||
flash, ok := s.inner.Values["_flash"]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
list := flash.([]any)
|
||||
if len(list) < 1 {
|
||||
return nil
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue