Fix null pointer dereferences and missing return checks
[claws.git] / src / gtk / gtkcmclist.c
index 737b2787ebd7568393a08c8cbf2f719cf76aef22..e58f8c565c7b7269c97ffc3c286f06898c4b8e01 100644 (file)
@@ -7417,7 +7417,9 @@ gtk_cmclist_merge (GtkCMCList *clist,
        }
     }
 
-  z.next->prev = NULL;
+  if (z.next)
+       z.next->prev = NULL;
+
   return z.next;
 }