mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: check lnclient is nil in GetPermittedMethods (#2343)
this caused a possible panic on shutdown
This commit is contained in:
parent
162965300e
commit
55d665db74
1 changed files with 4 additions and 0 deletions
|
|
@ -61,6 +61,10 @@ func (svc *permissionsService) HasPermission(app *db.App, scope string) (result
|
|||
}
|
||||
|
||||
func (svc *permissionsService) GetPermittedMethods(app *db.App, lnClient lnclient.LNClient) []string {
|
||||
if lnClient == nil {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
appPermissions := []db.AppPermission{}
|
||||
svc.db.Where("app_id = ?", app.ID).Find(&appPermissions)
|
||||
scopes := make([]string, 0, len(appPermissions))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue