From 7e898fdcf4ab2d89977b2ef8db448986b8b68a37 Mon Sep 17 00:00:00 2001 From: vague666 Date: Thu, 12 Mar 2020 22:52:12 +0100 Subject: [PATCH] Make sure witem exists --- src/fe-common/core/fe-core-commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fe-common/core/fe-core-commands.c b/src/fe-common/core/fe-core-commands.c index 9a2c547f..ea162e08 100644 --- a/src/fe-common/core/fe-core-commands.c +++ b/src/fe-common/core/fe-core-commands.c @@ -155,7 +155,9 @@ static void cmd_cat(const char *data, SERVER_REC *server, WI_ITEM_REC *item) return; } - target = g_hash_table_lookup(optlist, "window") != NULL ? item->name : NULL; + target = item != NULL && g_hash_table_lookup(optlist, "window") != NULL + ? item->name + : NULL; g_io_channel_set_encoding(handle, NULL, NULL); g_io_channel_seek_position(handle, fpos, G_SEEK_SET, NULL);