Skip to content

Commit 3fa5826

Browse files
committed
fix: do not require serverURLs if it’s already preset
This fix the error when init the leanengine SDK
1 parent 2a2d4f3 commit 3fa5826

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const AV = require('./av');
22
const AppRouter = require('./app-router');
33
const { isNullOrUndefined } = require('./utils');
4-
const { extend, isObject } = require('underscore');
4+
const { extend, isObject, isEmpty } = require('underscore');
55

66
const isCNApp = appId => appId.slice(-9) !== '-MdYXbMMI';
77

@@ -76,7 +76,7 @@ AV.init = function init(options, ...params) {
7676
if (process.env.CLIENT_PLATFORM && masterKey)
7777
console.warn('MasterKey is not supposed to be used in browser.');
7878
if (isCNApp(appId)) {
79-
if (!serverURLs) {
79+
if (!serverURLs && isEmpty(AV._config.serverURLs)) {
8080
throw new TypeError(
8181
`serverURLs option is required for apps from CN region`
8282
);

0 commit comments

Comments
 (0)