mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-03-14 22:48:35 +03:00
Fix 'index out of range' panic when adding a filter URL that has empty line in contents
This commit is contained in:
parent
b0549a8e5b
commit
bd0fa4cc4f
1 changed files with 1 additions and 1 deletions
|
@ -1148,7 +1148,7 @@ func (filter *filter) update(now time.Time) (bool, error) {
|
|||
d := dnsfilter.New()
|
||||
for _, line := range lines {
|
||||
line = strings.TrimSpace(line)
|
||||
if line[0] == '!' {
|
||||
if len(line) > 0 && line[0] == '!' {
|
||||
if m := filterTitle.FindAllStringSubmatch(line, -1); len(m) > 0 && len(m[0]) >= 2 && !seenTitle {
|
||||
log.Printf("Setting filter title to %s\n", m[0][1])
|
||||
filter.Name = m[0][1]
|
||||
|
|
Loading…
Add table
Reference in a new issue