Skip to content

Commit 493c540

Browse files
committed
Fixed bugs found during Static Analysis
1 parent f4ab008 commit 493c540

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Branch/BranchQRCode.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ - (void) getQRCodeAsData:(BranchUniversalObject*_Nullable)buo
4848

4949
if (self.codeColor) { settings[@"code_color"] = [self hexStringForColor:self.codeColor]; }
5050
if (self.backgroundColor) { settings[@"background_color"] = [self hexStringForColor:self.backgroundColor]; }
51-
if (self.margin) { settings[@"margin"] = self.margin; }
52-
if (self.width) { settings[@"width"] = self.width; }
51+
if ([self.margin intValue]) { settings[@"margin"] = self.margin; }
52+
if ([self.width intValue]) { settings[@"width"] = self.width; }
5353

5454
settings[@"image_format"] = (self.imageFormat == BranchQRCodeImageFormatJPEG) ? @"JPEG" : @"PNG";
5555

@@ -95,7 +95,7 @@ - (void)getQRCodeAsImage:(BranchUniversalObject *)buo
9595
linkProperties:(BranchLinkProperties *)lp
9696
completion:(void (^)(CIImage * _Nonnull, NSError * _Nonnull))completion {
9797

98-
[self getQRCodeAsData:buo linkProperties:lp completion:^(NSData * _Nonnull qrCode, NSError * _Nonnull error) {
98+
[self getQRCodeAsData:buo linkProperties:lp completion:^(NSData * _Nonnull qrCode, NSError * _Nullable error) {
9999
if (completion != nil) {
100100
if (error) {
101101
CIImage *img = [CIImage new];

0 commit comments

Comments
 (0)