]> source.dussan.org Git - gitea.git/commitdiff
Fix: url.Values map was not initialized (#14485)
authorPhilAtWysdom <phil@wysdom.co.uk>
Wed, 27 Jan 2021 13:33:32 +0000 (13:33 +0000)
committerGitHub <noreply@github.com>
Wed, 27 Jan 2021 13:33:32 +0000 (15:33 +0200)
Values map was not initialized, leading to error 500 on submission of initial configuration

Co-authored-by: 6543 <6543@obermui.de>
modules/middlewares/flash.go

index 38217288e81090153f5a2f0ec3415f71964538ef..732e1c76ea5549d1bf8d272d66bd40865c3402bb 100644 (file)
@@ -27,6 +27,9 @@ type Flash struct {
 }
 
 func (f *Flash) set(name, msg string, current ...bool) {
+       if f.Values == nil {
+               f.Values = make(map[string][]string)
+       }
        isShow := false
        if (len(current) == 0 && FlashNow) ||
                (len(current) > 0 && current[0]) {