@capgo/native-purchases 6.0.24 → 6.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -246,17 +246,20 @@ public class NativePurchasesPlugin extends Plugin {
246
246
  Number quantity = call.getInt("quantity", 1);
247
247
  // cannot use quantity, because it's done in native modal
248
248
  Log.d("CapacitorPurchases", "purchaseProduct: " + productIdentifier);
249
- if (productIdentifier.isEmpty()) {
249
+ if (productIdentifier == null || productIdentifier.isEmpty()) {
250
250
  // Handle error: productIdentifier is empty
251
251
  call.reject("productIdentifier is empty");
252
252
  return;
253
253
  }
254
- if (productType.isEmpty()) {
254
+ if (productType == null || productType.isEmpty()) {
255
255
  // Handle error: productType is empty
256
256
  call.reject("productType is empty");
257
257
  return;
258
258
  }
259
- if (productType.equals("subs") && planIdentifier.isEmpty()) {
259
+ if (
260
+ productType.equals("subs") &&
261
+ (planIdentifier == null || planIdentifier.isEmpty())
262
+ ) {
260
263
  // Handle error: no planIdentifier with productType subs
261
264
  call.reject("planIdentifier cannot be empty if productType is subs");
262
265
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-purchases",
3
- "version": "6.0.24",
3
+ "version": "6.0.27",
4
4
  "description": "In-app Subscriptions Made Easy",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",