summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-12-06 20:57:28 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-12-06 20:57:28 +0000
commit2e78d926efe7148e46f99ab57c8aa16816e474c4 (patch)
tree807c6ad9890a6b9c43564192e3255ca594174480 /src/fe-common/core
parente558f1252a0df15a2ee62ed7e283ea42578f177c (diff)
downloadirssi-2e78d926efe7148e46f99ab57c8aa16816e474c4.zip
$winref and $winname shouldn't crash if there's no active window.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2201 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/fe-expandos.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fe-common/core/fe-expandos.c b/src/fe-common/core/fe-expandos.c
index 8ef696f8..c14ac7c3 100644
--- a/src/fe-common/core/fe-expandos.c
+++ b/src/fe-common/core/fe-expandos.c
@@ -25,6 +25,9 @@
/* Window ref# */
static char *expando_winref(SERVER_REC *server, void *item, int *free_ret)
{
+ if (active_win == NULL)
+ return "";
+
*free_ret = TRUE;
return g_strdup_printf("%d", active_win->refnum);
}
@@ -32,6 +35,9 @@ static char *expando_winref(SERVER_REC *server, void *item, int *free_ret)
/* Window name */
static char *expando_winname(SERVER_REC *server, void *item, int *free_ret)
{
+ if (active_win == NULL)
+ return "";
+
return active_win->name;
}