mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Protect against nil dereference in group.Get.
This commit is contained in:
parent
f683675ab4
commit
184bd30077
1 changed files with 3 additions and 1 deletions
|
@ -496,7 +496,9 @@ func GetSubGroups(parent string) []SubGroup {
|
||||||
func Get(name string) *Group {
|
func Get(name string) *Group {
|
||||||
groups.mu.Lock()
|
groups.mu.Lock()
|
||||||
defer groups.mu.Unlock()
|
defer groups.mu.Unlock()
|
||||||
|
if groups.groups == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return groups.groups[name]
|
return groups.groups[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue