Skip to content

Commit b87f849

Browse files
committed
[HOTFIX] Fix poor override of CodelesslyConfig in Codelessly.initialize().
1 parent e4e3616 commit b87f849

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/src/codelessly.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,15 @@ class Codelessly {
500500

501501
_updateStatus(CStatus.loading(CLoadingState.initializing));
502502

503-
_config = config;
503+
if (config != null) {
504+
_config = config;
505+
}
506+
507+
assert(
508+
_config != null,
509+
'The SDK cannot be initialized without a configuration. '
510+
'Make sure you are correctly passing a [CodelesslyConfig] to the SDK.',
511+
);
504512

505513
log('Initializing Codelessly with firebase project ID: ${_config!.firebaseOptions.projectId}');
506514
log('Cloud Functions Base URL: ${_config!.firebaseCloudFunctionsBaseURL}');

0 commit comments

Comments
 (0)