diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-07-21 17:53:42 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-07-21 17:53:42 +0000 |
commit | 52decdef82fa132d941aef3901f50bd44825059d (patch) | |
tree | 23419b4189fba396e2daf8103ffb39b40f71d6a4 /plugins/MirLua | |
parent | f068533e2b39d52fdfd73b7ce9a2e663fd3a43f0 (diff) |
MirLua: fixed crash on script loading
git-svn-id: http://svn.miranda-ng.org/main/trunk@14599 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/src/mlua_script.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index aa181a3a22..bbc3fd4355 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -61,9 +61,13 @@ bool CMLuaScript::Load() lua_pushliteral(L, "Load");
lua_gettable(L, -2);
- if (lua_isfunction(L, -1) && lua_pcall(L, 0, 0, 0))
- CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1));
- lua_pop(L, 1);
+ if (lua_isfunction(L, -1))
+ {
+ if (lua_pcall(L, 0, 0, 0))
+ CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1));
+ }
+ else
+ lua_pop(L, 1);
lua_pushliteral(L, "Unload");
lua_gettable(L, -2);
|