- PurchaseController: added mHelper null check to the setup method
This commit is contained in:
Eugene Popovich 2013-04-10 13:47:39 +03:00
parent 1c52a91b8a
commit 6eaa95a027

View file

@ -131,8 +131,18 @@ public class PurchaseController {
// Hooray, IAB is fully set up. Now, let's get an inventory of // Hooray, IAB is fully set up. Now, let's get an inventory of
// stuff we own. // stuff we own.
CommonUtils.debug(TAG, "Setup successful. Querying inventory."); CommonUtils.debug(TAG, "Setup successful. Querying inventory.");
// need to check whether mHelper is not null. It may be null in
// case parent activity was destroyed such as action is async.
// Issue #382
if (mHelper != null)
{
mHelper.queryInventoryAsync(new GotInventoryListener(loadingControl), mHelper.queryInventoryAsync(new GotInventoryListener(loadingControl),
loadingControl); loadingControl);
} else
{
TrackerUtils.trackInAppBillingEvent("setup_result",
"fail: helper is null");
}
} }
}); });
} }