Protect against nil dereference in group.Get.
This commit is contained in:
+3
-1
@@ -496,7 +496,9 @@ func GetSubGroups(parent string) []SubGroup {
|
||||
func Get(name string) *Group {
|
||||
groups.mu.Lock()
|
||||
defer groups.mu.Unlock()
|
||||
|
||||
if groups.groups == nil {
|
||||
return nil
|
||||
}
|
||||
return groups.groups[name]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user