aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua_interface.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 443c7a9d..677e9709 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -1203,8 +1203,10 @@ static int l_ta_mt_index(lua_State *lua) {
else if (streq(key, "clipboard_text")) {
char *text =
gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
- if (text) lua_pushstring(lua, text);
- g_free(text);
+ if (text) {
+ lua_pushstring(lua, text);
+ g_free(text);
+ } else lua_pushstring(lua, "");
} else if (streq(key, "size")) {
lua_newtable(lua);
int width, height;