Fix: Check for nil from cmap Get
This commit is contained in:
parent
32f2b078c3
commit
9083cf55cf
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.idea
|
||||
*.save
|
||||
*.swp
|
||||
corpus/
|
||||
|
2
modes.go
2
modes.go
@ -421,7 +421,9 @@ func (p *UserPerms) MarshalJSON() ([]byte, error) {
|
||||
func (p *UserPerms) Lookup(channel string) (perms Perms, ok bool) {
|
||||
var permsi interface{}
|
||||
permsi, ok = p.channels.Get(ToRFC1459(channel))
|
||||
if ok {
|
||||
perms = permsi.(Perms)
|
||||
}
|
||||
return perms, ok
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user