<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8862">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx_lua:  Support displaying lua error message if no debug table exists<br><br>The lua_error_function assumed that lua's debug table and traceback function<br>are always accessible, which is not the case. This fixes the error message<br>'Error in the lua error handler' triggred by switch exec() function.<br>If this happens lua's error message is shown without traceback.<br><br>Change-Id: I34ba0a098f1ae06a3af7b4d1b098bd43f42f96c8<br>---<br>M pbx/pbx_lua.c<br>1 file changed, 12 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c<br>index 741e950..8673dfd 100644<br>--- a/pbx/pbx_lua.c<br>+++ b/pbx/pbx_lua.c<br>@@ -805,7 +805,19 @@<br>   lua_pushliteral(L, "\n");<br> <br>        lua_getglobal(L, "debug");<br>+ if (!lua_istable(L, -1)) {<br>+           /* Have no 'debug' table for whatever reason */<br>+              lua_pop(L, 2);<br>+               /*  Original err message is on stack top now */<br>+              return 1;<br>+    }<br>     lua_getfield(L, -1, "traceback");<br>+  if (!lua_isfunction(L, -1)) {<br>+                /* Same here for traceback function */<br>+               lua_pop(L, 3);<br>+               /*  Original err message is on stack top now */<br>+              return 1;<br>+    }<br>     lua_remove(L, -2); /* remove the 'debug' table */<br> <br>  lua_pushvalue(L, message_index);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8862">change 8862</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8862"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I34ba0a098f1ae06a3af7b4d1b098bd43f42f96c8 </div>
<div style="display:none"> Gerrit-Change-Number: 8862 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Christof Lauber <christof.lauber@annax.ch> </div>
<div style="display:none"> Gerrit-Reviewer: Christof Lauber <christof.lauber@annax.ch> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>