summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/common/servlist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/servlist.c b/src/common/servlist.c
index d121dd47..a0a85695 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -877,10 +877,15 @@ servlist_server_find (ircnet *net, char *name, int *pos)
 favchannel *
 servlist_favchan_find (ircnet *net, char *channel, int *pos)
 {
-	GSList *list = net->favchanlist;
+	GSList *list;
 	favchannel *favchan;
 	int i = 0;
 
+	if (net == NULL)
+		return NULL;
+
+	list = net->favchanlist;
+
 	while (list)
 	{
 		favchan = list->data;