changeset 1992:5dc408aacb14

Accept cmd_del(NULL) It was probably working already, but an explicit check is safer...
author Mikael Berthe <mikael@lilotux.net>
date Sun, 27 Mar 2011 20:30:35 +0200
parents 0450147afa05
children d4273346d52d
files mcabber/mcabber/commands.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/commands.c	Sun Mar 27 20:19:54 2011 +0200
+++ b/mcabber/mcabber/commands.c	Sun Mar 27 20:30:35 2011 +0200
@@ -107,6 +107,7 @@
 gpointer cmd_del(gpointer id)
 {
   GSList *sl_cmd;
+  if (!id) return NULL;
   for (sl_cmd = Commands; sl_cmd; sl_cmd = sl_cmd->next)
     if (sl_cmd -> data == id) {
       cmd *command = (cmd *) sl_cmd->data;