Skip to content

Commit 8ab423b

Browse files
authored
Merge pull request #181 from WideSpectrumComputing/GH180
Resolve GH180, GH176 and GH166
2 parents 41d8daa + 8190d02 commit 8ab423b

35 files changed

+344
-157
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co
2828
### 2.3.0
2929

3030
- feat: Detection of possible Out-of-Memory issues
31+
- fix: resolve #166 - v2.2.4 spams to log with NSLog on iOS
32+
- fix: resolve #176 - Rollbar crashes when device runs out of memory
33+
- fix: resolve #180 - SonarCloud: address current reliability issues
3134

3235
### 2.2.4
3336

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ let package = Package(
77
name: "RollbarSDK",
88
platforms: [
99
// Oldest targeted platform versions that are supported by this product.
10-
.macOS(.v10_11),
11-
.iOS(.v9),
12-
.tvOS(.v11),
10+
.macOS(.v10_15),
11+
.iOS(.v13),
12+
.tvOS(.v13),
1313
.watchOS(.v7),
1414
],
1515
products: [

RollbarAUL.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Pod::Spec.new do |s|
3333
# s.resources = "Resources/*.png"
3434

3535
# When using multiple platforms:
36-
s.osx.deployment_target = "10.11"
37-
# s.ios.deployment_target = "9.0"
38-
# s.tvos.deployment_target = "11.0"
39-
# s.watchos.deployment_target = "4.0"
36+
s.osx.deployment_target = "10.15"
37+
# s.ios.deployment_target = "13.0"
38+
# s.tvos.deployment_target = "13.0"
39+
# s.watchos.deployment_target = "7.0"
4040
# Any platform, if omitted:
4141
# s.platform = :ios
4242
# s.platform = :ios, "5.0"

RollbarAUL/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ let package = Package(
88
platforms: [
99
// Oldest targeted platform versions that are supported by this product.
1010
.macOS(.v10_15),
11-
.iOS(.v9),
12-
.tvOS(.v11),
11+
.iOS(.v13),
12+
.tvOS(.v13),
1313
.watchOS(.v7),
1414
],
1515
products: [

RollbarCocoaLumberjack.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Pod::Spec.new do |s|
3333
# s.resources = "Resources/*.png"
3434

3535
# When using multiple platforms:
36-
s.ios.deployment_target = "9.0"
37-
s.osx.deployment_target = "10.11"
38-
s.tvos.deployment_target = "11.0"
39-
s.watchos.deployment_target = "4.0"
36+
s.osx.deployment_target = "10.15"
37+
s.ios.deployment_target = "13.0"
38+
s.tvos.deployment_target = "13.0"
39+
s.watchos.deployment_target = "7.0"
4040
# Any platform, if omitted:
4141
# s.platform = :ios
4242
# s.platform = :ios, "5.0"

RollbarCocoaLumberjack/Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ let package = Package(
77
name: "RollbarCocoaLumberjack",
88
platforms: [
99
// Oldest targeted platform versions that are supported by this product.
10-
.macOS(.v10_11),
11-
.iOS(.v9),
12-
.tvOS(.v11),
10+
.macOS(.v10_15),
11+
.iOS(.v13),
12+
.tvOS(.v13),
1313
.watchOS(.v7),
1414
],
1515
products: [

RollbarCommon.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Pod::Spec.new do |s|
3333
# s.resources = "Resources/*.png"
3434

3535
# When using multiple platforms:
36-
s.ios.deployment_target = "9.0"
3736
s.osx.deployment_target = "10.11"
37+
s.ios.deployment_target = "9.0"
3838
s.tvos.deployment_target = "11.0"
3939
s.watchos.deployment_target = "4.0"
4040
# Any platform, if omitted:

RollbarCommon/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ let package = Package(
77
name: "RollbarCommon",
88
platforms: [
99
// Oldest targeted platform versions that are supported by this product.
10-
.macOS(.v10_10),
11-
.iOS(.v9),
12-
.tvOS(.v11),
13-
.watchOS(.v4),
10+
.macOS(.v10_15),
11+
.iOS(.v13),
12+
.tvOS(.v13),
13+
.watchOS(.v7),
1414
],
1515
products: [
1616
// Products define the executables and libraries produced by a package, and make them visible to other packages.

RollbarCommon/Sources/RollbarCommon/DTOs/RollbarDTO+Protected.m

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,29 @@ - (NSNumber *)safelyGetNumberByKey:(NSString *)key {
116116

117117
#pragma mark - data setters by key
118118

119-
- (void)setDictionary:(NSDictionary *)data forKey:(NSString *)key {
120-
[self setData:data.mutableCopy byKey:key];
119+
- (void)setDictionary:(nullable NSDictionary *)data forKey:(NSString *)key {
120+
121+
[self setData:data ? data.mutableCopy : data
122+
byKey:key
123+
];
121124
}
122125

123-
- (void)setArray:(NSArray *)data forKey:(NSString *)key {
124-
[self setData:data.mutableCopy byKey:key];
126+
- (void)setArray:(nullable NSArray *)data forKey:(NSString *)key {
127+
128+
[self setData:data ? data.mutableCopy : data
129+
byKey:key
130+
];
125131
}
126132

127-
- (void)setString:(NSString *)data forKey:(NSString *)key {
128-
[self setData:data.mutableCopy byKey:key];
133+
- (void)setString:(nullable NSString *)data forKey:(NSString *)key {
134+
135+
[self setData:data ? data.mutableCopy : data
136+
byKey:key
137+
];
129138
}
130139

131-
- (void)setNumber:(NSNumber *)data forKey:(NSString *)key {
140+
- (void)setNumber:(nullable NSNumber *)data forKey:(NSString *)key {
141+
132142
[self setData:data byKey:key];
133143
}
134144

RollbarCommon/Sources/RollbarCommon/DTOs/RollbarDTO.m

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,21 @@ @implementation RollbarDTO {
1010

1111
#pragma mark - JSON processing routines
1212

13-
+ (BOOL)isTransferableObject:(id)obj {
14-
BOOL result = [NSJSONSerialization isValidJSONObject:obj];
15-
return result;
13+
+ (BOOL)isTransferableObject:(nullable id)obj {
14+
15+
if (obj) {
16+
17+
BOOL result = [NSJSONSerialization isValidJSONObject:obj];
18+
return result;
19+
}
20+
else {
21+
22+
return NO;
23+
}
1624
}
1725

1826
+ (BOOL)isTransferableDataValue:(id)obj {
27+
1928
if (obj == [NSNull null]
2029
|| [obj isKindOfClass:[NSString class]]
2130
|| [obj isKindOfClass:[NSNumber class]]
@@ -338,24 +347,30 @@ - (instancetype)initWithDictionary:(nullable NSDictionary<NSString *, id> *)data
338347
self->_dataArray = nil;
339348
self->_dataDictionary = nil;
340349

341-
if (!data) {
350+
if (nil == data) {
351+
342352
data = [NSMutableDictionary dictionary];
343353
}
344354

345355
if (![RollbarDTO isTransferableObject:data]) {
356+
346357
return self;
347358
}
348359

349360
if ([data isKindOfClass:[NSMutableDictionary class]]) {
361+
350362
self->_data = (NSMutableDictionary *) data;
351363
}
352364
else {
365+
353366
self->_data = data.mutableCopy;
354367
}
355368
self->_dataArray = nil;
356369
self->_dataDictionary = (NSMutableDictionary<NSString *, id> *) self->_data;
357370
for (NSString *key in self->_dataDictionary.allKeys) {
371+
358372
if (self->_dataDictionary[key] == (id)[NSNull null]) {
373+
359374
[self->_dataDictionary removeObjectForKey:key];
360375
}
361376
}

0 commit comments

Comments
 (0)