From eeddfdab9bba69fa897c5b9df70cf75979f0409d Mon Sep 17 00:00:00 2001 From: dbeard Date: Thu, 1 Sep 2016 11:41:31 -0700 Subject: [PATCH] Check against self class in initialize methods --- ios/CodePush/CodePush.m | 6 ++++-- ios/CodePush/CodePushConfig.m | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ios/CodePush/CodePush.m b/ios/CodePush/CodePush.m index 1f993e2..152b9df 100644 --- a/ios/CodePush/CodePush.m +++ b/ios/CodePush/CodePush.m @@ -61,8 +61,10 @@ static NSString *bundleResourceSubdirectory = nil; + (void)initialize { - // Use the mainBundle by default. - bundleResourceBundle = [NSBundle mainBundle]; + if (self == [CodePush class]) { + // Use the mainBundle by default. + bundleResourceBundle = [NSBundle mainBundle]; + } } #pragma mark - Public Obj-C API diff --git a/ios/CodePush/CodePushConfig.m b/ios/CodePush/CodePushConfig.m index 7d12964..af75762 100644 --- a/ios/CodePush/CodePushConfig.m +++ b/ios/CodePush/CodePushConfig.m @@ -20,7 +20,9 @@ static NSString * const ServerURLConfigKey = @"serverUrl"; + (void)initialize { - _currentConfig = [[CodePushConfig alloc] init]; + if (self == [CodePushConfig class]) { + _currentConfig = [[CodePushConfig alloc] init]; + } } - (instancetype)init