NullReferenceException in TransactionCurrencyConverter.Convert method when a purchase fails

Hi,

We’ve seen a few reports come through with the following stack trace

Unity.Services.Analytics.TransactionCurrencyConverter.Convert (line 28)
UnityEngine.Purchasing.AnalyticsAdapter.GenerateRealCurrencySpentOnPurchase
UnityEngine.Purchasing.AnalyticsAdapter.BuildTransactionFailedParameters
UnityEngine.Purchasing.AnalyticsAdapter.SendTransactionFailedEvent
UnityEngine.Purchasing.AnalyticsClient.OnPurchaseFailed
UnityEngine.Purchasing.StoreListenerProxy.OnPurchaseFailed
Store.PurchaseIAP (our code)

We’re using:
com.unity.packaging 4.5.0
com.unity.services.analytics 4.2.0
Unity 2021.3.13f1

So far we’ve only seen the issue occur on Android.

Any advice would be appreciated, cheers

Hi @jperryoddgames ,

This bug should have been fixed in version 4.5.1. Also note 4.5.2 is now available.

This bug occurred when canceling purchases or trying to buy products not currently available. In those cases the currency value couldn’t be parsed by the Analytics module.

1 Like

Thanks for the quick reply, we’ll update the package now