summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bounce.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/bounce.h b/bounce.h
index e196ed0..93a3c89 100644
--- a/bounce.h
+++ b/bounce.h
@@ -69,8 +69,8 @@ struct Message {
 
 static inline struct Message parse(char *line) {
 	struct Message msg = {0};
-	if (line[0] == '@') msg.tags = 1 + strsep(&line, " ");
-	if (line[0] == ':') msg.origin = 1 + strsep(&line, " ");
+	if (line && line[0] == '@') msg.tags = 1 + strsep(&line, " ");
+	if (line && line[0] == ':') msg.origin = 1 + strsep(&line, " ");
 	msg.cmd = strsep(&line, " ");
 	for (size_t i = 0; line && i < ParamCap; ++i) {
 		if (line[0] == ':') {