summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_vi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 994b44fe3..9e39143d0 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -401,7 +401,7 @@ vichange(UNUSED(char **args))
 	forekill(c2 - zlecs, CUT_RAW);
 	selectkeymap("main", 1);
 	viinsbegin = zlecs;
-	vistartchange = curchange->prev->changeno;
+	vistartchange = (curchange && curchange->prev) ? curchange->prev->changeno : 0;
     }
     return ret;
 }