Skip to content

Commit

Permalink
Merge pull request microsoft#506 from daniel-beard/dbeard_add_class_g…
Browse files Browse the repository at this point in the history
…uard_in_initialize_method

Check against self class in initialize methods
  • Loading branch information
geof90 authored Sep 1, 2016
2 parents 77679d8 + eeddfda commit 5ebfdf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ios/CodePush/CodePush.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ @implementation CodePush {

+ (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
Expand Down
4 changes: 3 additions & 1 deletion ios/CodePush/CodePushConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ + (instancetype)current

+ (void)initialize
{
_currentConfig = [[CodePushConfig alloc] init];
if (self == [CodePushConfig class]) {
_currentConfig = [[CodePushConfig alloc] init];
}
}

- (instancetype)init
Expand Down

0 comments on commit 5ebfdf7

Please sign in to comment.