提交 4774c2a3 authored 作者: Varun Kumaar's avatar Varun Kumaar

fix: check if options is present before checking name in options.

上级 1b6feec4
...@@ -48,7 +48,7 @@ exports.createClient = () => ({ ...@@ -48,7 +48,7 @@ exports.createClient = () => ({
}))); })));
} }
else { else {
if (options.name.length !== 0) { if (options.name && options.name.length !== 0) {
defaultKey = options.name; defaultKey = options.name;
} }
clients.set(defaultKey, yield getClient(options)); clients.set(defaultKey, yield getClient(options));
......
...@@ -38,7 +38,7 @@ export const createClient = (): Provider => ({ ...@@ -38,7 +38,7 @@ export const createClient = (): Provider => ({
}), }),
); );
} else { } else {
if (options.name.length !== 0) { if (options.name && options.name.length !== 0) {
defaultKey = options.name; defaultKey = options.name;
} }
clients.set(defaultKey, await getClient(options)); clients.set(defaultKey, await getClient(options));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论