From 338c9def1f1fe00920f306b57208a3a8878e9d1c Mon Sep 17 00:00:00 2001 From: Minggang Wang Date: Wed, 25 May 2016 17:49:20 +0800 Subject: [PATCH] [IAP]Throw an error when productIds is undefined When calling queryProductsInfo with the productIds, which is undefined, the Promise should reject with an error named "InvalidAccessError". BUG=XWAL-6931 --- iap/iap.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iap/iap.js b/iap/iap.js index a5c8fc6..078240d 100644 --- a/iap/iap.js +++ b/iap/iap.js @@ -53,6 +53,8 @@ exports.queryProductsInfo = function(productIds) { if (!g_initialized) { throw new DOMError("InvalidStateError"); } + if (typeof(productIds) === "undefined") + throw new DOMError("InvalidAccessError"); var requestId = createAsyncRequest(resolve, reject); sendAsycRequest("queryProductsInfo", requestId, productIds); });