Skip to content

Commit

Permalink
Don't crash if innerException is null (#642)
Browse files Browse the repository at this point in the history
* Don't crash if innerException is null

* Log outer exception if InnerException is null

---------

Co-authored-by: Tal Zaccai <talzacc@microsoft.com>
  • Loading branch information
mmclure-msft and TalZaccai authored Sep 5, 2024
1 parent 1d5c06c commit b92c3dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/server/Lua/LuaCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ private unsafe bool ExecuteScript(int count, LuaRunner scriptRunner)
}
catch (LuaScriptException ex)
{
logger?.LogError(ex.InnerException, "Error executing Lua script callback");
while (!RespWriteUtils.WriteError("ERR " + ex.InnerException.Message, ref dcurr, dend))
logger?.LogError(ex.InnerException ?? ex, "Error executing Lua script callback");
while (!RespWriteUtils.WriteError("ERR " + (ex.InnerException ?? ex).Message, ref dcurr, dend))
SendAndReset();
return true;
}
Expand Down

0 comments on commit b92c3dc

Please sign in to comment.