diff --git a/src/xpdev/str_list.c b/src/xpdev/str_list.c
index 7c5d2577a6cb360a77567a6a02850d821c10bcf5..51e37b03dbd450c371742f3cf6b1ac39e5d36d1f 100644
--- a/src/xpdev/str_list.c
+++ b/src/xpdev/str_list.c
@@ -702,7 +702,7 @@ char* strListJoin(const str_list_t list, char* buf, size_t buflen, const char* s
 {
 	size_t		i;
 
-	if(buflen < 1)
+	if(buf == NULL || buflen < 1)
 		return NULL;
 
 	*buf = '\0';