From dec5d521b711a74d36db4a26adea457e714cb94f Mon Sep 17 00:00:00 2001 From: Phillip Moore Date: Thu, 3 Jul 2014 10:58:18 -0500 Subject: [PATCH] Also update for fail regexes Update for fail regexes too (same issue as IPList) --- jail.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jail.go b/jail.go index 63b4b44..5092e06 100644 --- a/jail.go +++ b/jail.go @@ -18,6 +18,10 @@ func jailGetHandler(res http.ResponseWriter, req *http.Request, fail2goConn *fai if IPList == nil { IPList = []string{} } + //If failRegexes is nil/null/doesn't exist, then initialize it to an empty string array. This resolves the front end issue where a null value is trying to be parsed for the list of regular expressions. + if(failRegexes == nil { + failRegexes = []string{} + } encodedOutput, err := json.Marshal(map[string]interface{}{ "currentlyFailed": currentlyFailed,