@@ -2072,9 +2072,9 @@ - (void)configureKits:(NSArray<NSDictionary *> *)kitConfigurations {
20722072
20732073 MPILogDebug (@" configureKits - configuring kit %@ (existing instance: %@ )" , integrationId, kitInstance ? @" YES" : @" NO" );
20742074
2075+ BOOL disabled = [self isKitDisabled: kitRegister.code];
2076+
20752077 if (kitInstance) {
2076-
2077- BOOL disabled = [self isKitDisabled: kitRegister.code];
20782078 if (disabled) {
20792079 kitRegister.wrapperInstance = nil ;
20802080 } else {
@@ -2093,26 +2093,27 @@ - (void)configureKits:(NSArray<NSDictionary *> *)kitConfigurations {
20932093
20942094 if (kitInstance) {
20952095 [self updateBracketsWithConfiguration: kitConfiguration.bracketConfiguration integrationId: integrationId];
2096- if (![kitInstance started ]) {
2097- if ([kitInstance respondsToSelector: @selector (setLaunchOptions: )]) {
2098- [kitInstance performSelector: @selector (setLaunchOptions: ) withObject: stateMachine.launchOptions];
2099- }
2100-
2101- if ([kitInstance respondsToSelector: @selector (start )]) {
2102- @try {
2103- [kitInstance start ];
2104- }
2105- @catch (NSException *exception) {
2106- MPILogError (@" Exception thrown while starting kit (%@ ): %@ " , kitInstance, exception);
2107- }
2108- }
2109- }
21102096 }
21112097
21122098 [self updateBracketsWithConfiguration: kitConfiguration.bracketConfiguration integrationId: integrationId];
21132099 }
21142100
21152101 if (kitInstance) {
2102+ if (![kitInstance started ] && !disabled) {
2103+ if ([kitInstance respondsToSelector: @selector (setLaunchOptions: )]) {
2104+ [kitInstance performSelector: @selector (setLaunchOptions: ) withObject: stateMachine.launchOptions];
2105+ }
2106+
2107+ if ([kitInstance respondsToSelector: @selector (start )]) {
2108+ @try {
2109+ [kitInstance start ];
2110+ }
2111+ @catch (NSException *exception) {
2112+ MPILogError (@" Exception thrown while starting kit (%@ ): %@ " , kitInstance, exception);
2113+ }
2114+ }
2115+ }
2116+
21162117 NSArray *alreadySynchedUserAttributes = userDefaults[kMPSynchedUserAttributesKey ];
21172118 if (userAttributes && ![alreadySynchedUserAttributes containsObject: integrationId]) {
21182119 NSMutableArray *synchedUserAttributes = [[NSMutableArray alloc ] initWithCapacity: alreadySynchedUserAttributes.count + 1 ];
0 commit comments