Skip to content
This repository was archived by the owner on Sep 14, 2020. It is now read-only.

Commit 4816169

Browse files
committed
fix: ignore empty api key from react native
Ignores empty api keys when initialising react native, preferring to use the existing config.apiKey instead
1 parent dce877a commit 4816169

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cocoa/BugsnagReactNative.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ + (void)startWithConfiguration:(BugsnagConfiguration *)config {
215215
NSString *appVersion = [RCTConvert NSString:options[@"appVersion"]];
216216
NSString *codeBundleId = [RCTConvert NSString:options[@"codeBundleId"]];
217217
BugsnagConfiguration* config = [Bugsnag bugsnagStarted] ? [Bugsnag configuration] : [BugsnagConfiguration new];
218-
config.apiKey = apiKey;
218+
219+
if (apiKey != nil && apiKey.length > 0) {
220+
config.apiKey = apiKey;
221+
}
222+
219223
config.releaseStage = releaseStage;
220224
config.notifyReleaseStages = notifyReleaseStages;
221225
config.autoNotify = [RCTConvert BOOL:options[@"autoNotify"]];

0 commit comments

Comments
 (0)