2 Commits
5.0.0 ... 5.0.1

Author SHA1 Message Date
Björn Ritzl
f97a7ee6b6 Merge pull request #55 from defold/fix-json-migration-issue
Push nil as last argument if there is no error
2022-11-21 10:30:12 +01:00
Björn Ritzl
5f3f43fb2e Push nil as last argument if there is no error 2022-11-21 10:21:12 +01:00
2 changed files with 4 additions and 0 deletions

View File

@@ -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);

View File

@@ -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)