3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix rare crash if isOwner() is called before the global config is loaded

This commit is contained in:
Dragory 2021-09-04 22:11:08 +03:00
parent 0b6e61bf25
commit e95987a766
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -232,7 +232,7 @@ export function getBaseUrl(pluginData: AnyPluginData<any>) {
export function isOwner(pluginData: AnyPluginData<any>, userId: string) {
const knub = pluginData.getKnubInstance() as TZeppelinKnub;
const owners = knub.getGlobalConfig().owners;
const owners = knub.getGlobalConfig()?.owners;
if (!owners) {
return false;
}