summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiftob/LuaCommands.cpp')
-rw-r--r--Swiftob/LuaCommands.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Swiftob/LuaCommands.cpp b/Swiftob/LuaCommands.cpp
index 1192452..18535f3 100644
--- a/Swiftob/LuaCommands.cpp
+++ b/Swiftob/LuaCommands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -380,7 +380,7 @@ int LuaCommands::get_setting(lua_State *L) {
void LuaCommands::handleLuaListener(int callbackIndex, lua_State* L, Swift::Message::ref message) {
lua_rawgeti(L, LUA_REGISTRYINDEX, callbackIndex);
- lua_pushstring(L, message->getBody().c_str());
+ lua_pushstring(L, message->getBody().get_value_or("").c_str());
lua_pushstring(L, message->getFrom().toBare().toString().c_str());
lua_pushstring(L, message->getFrom().getResource().c_str());
messageOntoStack(message, L);
@@ -426,7 +426,7 @@ void LuaCommands::messageOntoStack(Swift::Message::ref message, lua_State* L) {
lua_setfield(L, -2, "frombare");
lua_pushstring(L, message->getTo().toString().c_str());
lua_setfield(L, -2, "to");
- lua_pushstring(L, message->getBody().c_str());
+ lua_pushstring(L, message->getBody().get_value_or("").c_str());
lua_setfield(L, -2, "body");
}