{"action":"opened","issue":{"url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/276","repository_url":"https://api.github.com/repos/dooboolab/react-native-iap","labels_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/276/comments","events_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/276/events","html_url":"https://github.com/dooboolab/react-native-iap/issues/276","id":365467033,"node_id":"MDU6SXNzdWUzNjU0NjcwMzM=","number":276,"title":"Buying a subscription fails with a Fatal Exception: java.lang.NullPointerException","user":{"login":"7kfpun","id":2672802,"node_id":"MDQ6VXNlcjI2NzI4MDI=","avatar_url":"https://avatars2.githubusercontent.com/u/2672802?v=4","gravatar_id":"","url":"https://api.github.com/users/7kfpun","html_url":"https://github.com/7kfpun","followers_url":"https://api.github.com/users/7kfpun/followers","following_url":"https://api.github.com/users/7kfpun/following{/other_user}","gists_url":"https://api.github.com/users/7kfpun/gists{/gist_id}","starred_url":"https://api.github.com/users/7kfpun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/7kfpun/subscriptions","organizations_url":"https://api.github.com/users/7kfpun/orgs","repos_url":"https://api.github.com/users/7kfpun/repos","events_url":"https://api.github.com/users/7kfpun/events{/privacy}","received_events_url":"https://api.github.com/users/7kfpun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-01T13:41:05Z","updated_at":"2018-10-01T13:41:05Z","closed_at":null,"author_association":"NONE","body":"### Version of react-native-iap\r\nreact-native-iap: 2.2.2\r\nreact-native: 0.47.0\r\n\r\n### Platforms you faced the error (IOS or Android or both?)\r\nAndroid\r\n\r\n### Expected behavior\r\nPurchase successfully\r\n\r\n### Actual behavior\r\nBuying a subscription fails with a runtime exception:\r\n\r\nFatal Exception: java.lang.NullPointerException\r\nAttempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference\r\n\r\n```\r\nFatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference\r\n       at com.dooboolab.RNIap.RNIapModule$11.onPurchasesUpdated(RNIapModule.java:413)\r\n       at com.android.billingclient.api.BillingClientImpl$1.onReceive(BillingClientImpl.java:136)\r\n       at com.android.billingclient.api.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:303)\r\n       at com.android.billingclient.api.LocalBroadcastManager.access$000(LocalBroadcastManager.java:44)\r\n       at com.android.billingclient.api.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:114)\r\n       at android.os.Handler.dispatchMessage(Handler.java:106)\r\n       at android.os.Looper.loop(Looper.java:164)\r\n       at android.app.ActivityThread.main(ActivityThread.java:6501)\r\n       at java.lang.reflect.Method.invoke(Method.java)\r\n       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)\r\n       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)\r\n```\r\n\r\n### Tested environment (Emulator? Real Device?)\r\nReal device (signed APK)\r\n\r\n### Steps to reproduce the behavior\r\n\r\nawait RNIap.initConnection();\r\nawait RNIap.getProducts(itemSkus);\r\nawait RNIap.buySubscription(product.productId);"}}
{"actor":{"display_login":"7kfpun"}}