mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
check if string msg is not NULL, fix segfault
Origin commit data
------------------
Branch: ni/coolstream
Commit: c9e8a57418
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2016-05-19 (Thu, 19 May 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -56,8 +56,10 @@ bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAc
|
||||
lua_pushstring(L, optionValue);
|
||||
int status = lua_pcall(L, 2 /* two args */, 1 /* one result */, 0);
|
||||
if (status) {
|
||||
fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1));
|
||||
DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:");
|
||||
bool isString = lua_isstring(L,-1);
|
||||
const char *null = "NULL";
|
||||
fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1): null);
|
||||
DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:");
|
||||
}
|
||||
double res = lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0;
|
||||
return (((int)res == menu_return::RETURN_REPAINT) || ((int)res == menu_return::RETURN_EXIT_REPAINT));
|
||||
@@ -135,8 +137,10 @@ int CLuaMenuForwarder::exec(CMenuTarget* /*parent*/, const std::string & /*actio
|
||||
lua_pushstring(L, luaId.c_str());
|
||||
int status = lua_pcall(L, 1 /* one arg */, 1 /* one result */, 0);
|
||||
if (status) {
|
||||
fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1));
|
||||
DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:");
|
||||
bool isString = lua_isstring(L,-1);
|
||||
const char *null = "NULL";
|
||||
fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null);
|
||||
DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:");
|
||||
}
|
||||
if (lua_isnumber(L, -1))
|
||||
res = (int) lua_tonumber(L, -1);
|
||||
@@ -179,8 +183,10 @@ int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*acti
|
||||
lua_pushstring(L, value->c_str());
|
||||
int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0);
|
||||
if (status) {
|
||||
fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1));
|
||||
DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:");
|
||||
bool isString = lua_isstring(L,-1);
|
||||
const char *null = "NULL";
|
||||
fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null);
|
||||
DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:");
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
@@ -222,8 +228,10 @@ int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*act
|
||||
lua_pushstring(L, value->c_str());
|
||||
int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0);
|
||||
if (status) {
|
||||
fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1));
|
||||
DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:");
|
||||
bool isString = lua_isstring(L,-1);
|
||||
const char *null = "NULL";
|
||||
fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null);
|
||||
DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:");
|
||||
}
|
||||
lua_pop(L, 2);
|
||||
}
|
||||
@@ -260,8 +268,10 @@ int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*a
|
||||
lua_pushstring(L, value->c_str());
|
||||
int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0);
|
||||
if (status) {
|
||||
fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1));
|
||||
DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:");
|
||||
bool isString = lua_isstring(L,-1);
|
||||
const char *null = "NULL";
|
||||
fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null);
|
||||
DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:");
|
||||
}
|
||||
lua_pop(L, 2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user