Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit eeddfda

Browse files
author
dbeard
committed
Check against self class in initialize methods
1 parent 77679d8 commit eeddfda

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ios/CodePush/CodePush.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ @implementation CodePush {
6161

6262
+ (void)initialize
6363
{
64-
// Use the mainBundle by default.
65-
bundleResourceBundle = [NSBundle mainBundle];
64+
if (self == [CodePush class]) {
65+
// Use the mainBundle by default.
66+
bundleResourceBundle = [NSBundle mainBundle];
67+
}
6668
}
6769

6870
#pragma mark - Public Obj-C API

ios/CodePush/CodePushConfig.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ + (instancetype)current
2020

2121
+ (void)initialize
2222
{
23-
_currentConfig = [[CodePushConfig alloc] init];
23+
if (self == [CodePushConfig class]) {
24+
_currentConfig = [[CodePushConfig alloc] init];
25+
}
2426
}
2527

2628
- (instancetype)init

0 commit comments

Comments
 (0)