syntax fixes

This commit is contained in:
ston1th 2021-11-05 21:55:18 +01:00
commit 1ce33aa89a
13 changed files with 45 additions and 43 deletions

View file

@ -30,7 +30,11 @@ func (db *DB) GetAllSections(username string, admin bool) (sections core.Section
}
p, err := db.getPage(k, username)
if err == nil {
s := k[:strings.Index(k, "/")]
i := strings.Index(k, "/")
if i == -1 {
return nil
}
s := k[:i]
if _, ok := m[s]; !ok {
m[s] = core.UpdatedPages{}
}