mirror of
https://github.com/defold/extension-iap
synced 2025-06-27 02:17:51 +02:00
Push nil as last argument if there is no error
This commit is contained in:
parent
caff4397d8
commit
5f3f43fb2e
@ -308,6 +308,7 @@ static void HandleProductResult(const IAPCommand* cmd)
|
||||
if (cmd->m_ResponseCode == BILLING_RESPONSE_RESULT_OK) {
|
||||
const char* json = (const char*)cmd->m_Data;
|
||||
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
||||
lua_pushnil(L);
|
||||
} else {
|
||||
dmLogError("IAP error %d", cmd->m_ResponseCode);
|
||||
lua_pushnil(L);
|
||||
@ -343,6 +344,7 @@ static void HandlePurchaseResult(const IAPCommand* cmd)
|
||||
if (cmd->m_Data != 0) {
|
||||
const char* json = (const char*)cmd->m_Data;
|
||||
dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
|
||||
lua_pushnil(L);
|
||||
} else {
|
||||
dmLogError("IAP error, purchase response was null");
|
||||
lua_pushnil(L);
|
||||
|
@ -47,6 +47,7 @@ static void IAPList_Callback(void* luacallback, const char* result_json)
|
||||
if(result_json != 0)
|
||||
{
|
||||
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
||||
lua_pushnil(L);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -97,6 +98,7 @@ static void IAPListener_Callback(void* luacallback, const char* result_json, int
|
||||
|
||||
if (result_json) {
|
||||
dmScript::JsonToLua(L, result_json, strlen(result_json)); // throws lua error if it fails
|
||||
lua_pushnil(L);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
switch(error_code)
|
||||
|
Loading…
x
Reference in New Issue
Block a user