Browse Source

modules_k/dialog: Enhance unref_dlg_from_cb() robustness.

- Check parameter for NULL pointer.
- Call unreference_dlg(), thus being more wrapper-ish.
- Fix indention.
Timo Reimann 15 years ago
parent
commit
75fc49f74d
1 changed files with 5 additions and 2 deletions
  1. 5 2
      modules_k/dialog/dlg_handlers.c

+ 5 - 2
modules_k/dialog/dlg_handlers.c

@@ -820,10 +820,13 @@ static void unreference_dialog(void *dialog)
  */
  */
 static void unref_dlg_from_cb(struct cell* t, int type, struct tmcb_params *param)
 static void unref_dlg_from_cb(struct cell* t, int type, struct tmcb_params *param)
 {
 {
-    struct dlg_cell *dlg = (struct dlg_cell *)(*param->param);
+	struct dlg_cell *dlg = (struct dlg_cell *)(*param->param);
+
+	if (!dlg)
+		return;
 
 
 	/* destroy dialog */
 	/* destroy dialog */
-    unref_dlg(dlg, 1);
+	unreference_dialog(dlg);
 }
 }