From 9b0e6781bb3f3f1caa34660755571e6a79a5096d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Can=20K=C3=BC=C3=A7=C3=BCkaslan?= Date: Tue, 13 Sep 2022 14:26:28 +0300 Subject: [PATCH] storage/url: add nil check for URL.filterRegex in URL.Match --- storage/url/url.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/url/url.go b/storage/url/url.go index 22ab37df7..755227fff 100644 --- a/storage/url/url.go +++ b/storage/url/url.go @@ -326,6 +326,10 @@ func (u *URL) SetRelative(base *URL) { // Match reports whether if given key matches with the object. func (u *URL) Match(key string) bool { + if u.filterRegex == nil { + return false + } + if !u.filterRegex.MatchString(key) { return false }