mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
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
This commit is contained in:
parent
53b4ad6c58
commit
4ebe07e0d1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user