From 4ebe07e0d17281726097ffff255de6a985252046 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 29 Nov 2001 22:05:24 +0000 Subject: [PATCH] command_unbind() - don't crash if trying to unbind a command not registered in given module. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2166 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/commands.c b/src/core/commands.c index ad4b8bd0..d126c358 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -224,6 +224,8 @@ void command_unbind(const char *cmd, SIGNAL_FUNC func) rec = command_find(cmd); if (rec != NULL) { modrec = command_module_find_func(rec, func); + g_return_if_fail(modrec != NULL); + modrec->signals = g_slist_remove(modrec->signals, func); if (modrec->signals == NULL) command_module_destroy(rec, modrec);