Getting nullPointerException when trying to get product price

Hello, I’m trying to retreive the price of my product from unity, and its giving me this error. I added the products onto my unity dashboard, so I’m not sure why its giving me problems.

And I purposefully used a string literal to show that I couldn’t have been passing a null parameter; that will change.

4819292--461873--Capturefddf gds.PNG

Hardest null pointer exception in my life…

You must add your products to the app store you are targeting (e.g. Google Play Store, Apple App Store, etc.):
https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html
https://docs.unity3d.com/Manual/UnityIAPAppleConfiguration.html

(The products in the Unity dashboard are meant for IAP Promo, which is a product to advertise your In-app purchase products.)

You must also define your products in the Editor, either through scripts or via the Product Catalog:
https://docs.unity3d.com/Manual/UnityIAPDefiningProducts.html