Commit Diff


commit - aed6fae9351da8336f0fe314a01c540225945f0f
commit + a87cfde96c9247f99db3ea7310131bdefeda3540
blob - 11272ddde04c92c81e5f6d39afb2eb36cc9b4702
blob + 5e7bcfe55b4d8f4f5f6a596ce59f9302ed08dd2a
--- cmd.c
+++ cmd.c
@@ -144,7 +144,7 @@ cmd_move_end_of_line(struct buffer *buffer)
 	struct vline	*vl;
 
 	vl = buffer->current_line;
-	if (vl->line == NULL)
+	if (vl == NULL || vl->line == NULL)
 		return;
 	buffer->cpoff = utf8_cplen(vl->line);
 }
@@ -243,6 +243,10 @@ cmd_push_button(struct buffer *buffer)
 	struct line	*l;
 
 	vl = buffer->current_line;
+
+	if (vl == NULL)
+		return;
+
 	switch (vl->parent->type) {
 	case LINE_LINK:
 		load_url_in_tab(current_tab, vl->parent->alt);
@@ -270,7 +274,7 @@ cmd_push_button_new_tab(struct buffer *buffer)
 	struct vline	*vl;
 
 	vl = buffer->current_line;
-	if (vl->parent->type != LINE_LINK)
+	if (vl == NULL || vl->parent->type != LINE_LINK)
 		return;
 
 	new_tab(vl->parent->alt);