File tree 2 files changed +16
-13
lines changed
2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -372,12 +372,13 @@ void _AdjustGetAttribution(AdjustDelegateAttributionGetter callback) {
372
372
addValueOrEmpty (dictionary, @" costType" , attribution.costType );
373
373
addValueOrEmpty (dictionary, @" costAmount" , attribution.costAmount );
374
374
addValueOrEmpty (dictionary, @" costCurrency" , attribution.costCurrency );
375
-
376
- NSData *jsonData = [NSJSONSerialization dataWithJSONObject: attribution.jsonResponse
377
- options: 0
378
- error: nil ];
379
- NSString *strJsonResponse = [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding];
380
- addValueOrEmpty (dictionary, @" jsonResponse" , strJsonResponse);
375
+ if (attribution.jsonResponse != nil ) {
376
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject: attribution.jsonResponse
377
+ options: 0
378
+ error: nil ];
379
+ NSString *strJsonResponse = [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding];
380
+ addValueOrEmpty (dictionary, @" jsonResponse" , strJsonResponse);
381
+ }
381
382
382
383
NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject: dictionary
383
384
options: 0
Original file line number Diff line number Diff line change @@ -124,13 +124,15 @@ - (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
124
124
forKey: @" costCurrency"
125
125
toDictionary: dictionary];
126
126
127
- NSData *jsonData = [NSJSONSerialization dataWithJSONObject: attribution.jsonResponse
128
- options: 0
129
- error: nil ];
130
- NSString *strJsonResponse = [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding];
131
- [self addValueOrEmpty: strJsonResponse
132
- forKey: @" jsonResponse"
133
- toDictionary: dictionary];
127
+ if (attribution.jsonResponse != nil ) {
128
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject: attribution.jsonResponse
129
+ options: 0
130
+ error: nil ];
131
+ NSString *strJsonResponse = [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding];
132
+ [self addValueOrEmpty: strJsonResponse
133
+ forKey: @" jsonResponse"
134
+ toDictionary: dictionary];
135
+ }
134
136
135
137
NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject: dictionary
136
138
options: 0
You can’t perform that action at this time.
0 commit comments