Skip to content

Commit a09d46f

Browse files
authored
Merge pull request #2 from singular-labs/hotfix/sdkdev-245-fix-handler-npe
hotfix of caught npe when no device attribution handler
2 parents 07d8614 + 7989324 commit a09d46f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

SingularSDK/Runtime/SingularSDK.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ private void SingularDeviceAttributionCallback(string handlerParamsJson)
962962
Debug.Log(string.Format("SingularSDK SingularDeviceAttributionCallback called! message='{0}'",
963963
handlerParamsJson));
964964

965-
if (handlerParamsJson != null)
965+
if (registeredDeviceAttributionCallbackHandler != null && handlerParamsJson != null)
966966
{
967967
Dictionary<string, object> attributes =
968968
JsonConvert.DeserializeObject<Dictionary<string, object>>(handlerParamsJson);
@@ -1038,14 +1038,11 @@ private void ResolveSingularLink()
10381038
{
10391039
if (registeredSingularLinkHandler != null)
10401040
{
1041-
10421041
registeredSingularLinkHandler.OnSingularLinkResolved(instance.resolvedSingularLinkParams);
10431042
instance.resolvedSingularLinkParams = null;
1044-
10451043
}
10461044
else if (registeredDDLHandler != null)
10471045
{
1048-
10491046
if (ddlTimeoutSec <= 0)
10501047
{
10511048
ddlTimeoutSec = DEFAULT_DDL_TIMEOUT;
@@ -1139,8 +1136,7 @@ private void SingularSdidReceived(string result)
11391136
}
11401137

11411138
#endregion // end sdid
1142-
1143-
1139+
11441140
#if UNITY_5_3_OR_NEWER && UNITY_PURCHASING
11451141

11461142
public static void InAppPurchase(IEnumerable<Product> products, Dictionary<string, object> attributes, bool isRestored

0 commit comments

Comments
 (0)