Skip to content

Commit 515bc58

Browse files
authored
Fixes (#75)
* fixing a crash when passing null as options
1 parent 6e9f4b8 commit 515bc58

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Leanplum-Unity-SDK/Assets/LeanplumSDK/Apple/LeanplumApple.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public override void DefineAction(string name, Constants.ActionKind kind, Action
410410
}
411411

412412
string argString = args == null ? null : args.ToJSON();
413-
string optionString = options == null ? null : Json.Serialize(options);
413+
string optionString = options == null ? "" : Json.Serialize(options);
414414

415415
_defineAction(name, (int) kind, argString, optionString);
416416
}

Leanplum-Unity-SDK/Assets/Plugins/iOS/LeanplumIOSBridge.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@ void _defineAction(const char* name, int kind, const char *args, const char *opt
371371
NSDictionary *optionsDictionary = [NSJSONSerialization JSONObjectWithData:optionsData
372372
options:NSUTF8StringEncoding
373373
error:nil];
374+
if (optionsDictionary == nil) {
375+
optionsDictionary = @{};
376+
}
377+
374378

375379
NSMutableArray *arguments = [NSMutableArray new];
376380

0 commit comments

Comments
 (0)