updated for version 7.0151
diff --git a/src/ui.c b/src/ui.c
index 04e273a..4449bfd 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1142,6 +1142,10 @@
     int		row2 = clip_star.end.lnum;
     int		col2 = clip_star.end.col;
 
+    /* Can't use ScreenLines unless initialized */
+    if (ScreenLines == NULL)
+	return;
+
     /*
      * Make sure row1 <= row2, and if row1 == row2 that col1 <= col2.
      */
@@ -1312,7 +1316,7 @@
     int		mboff;
 #endif
 
-    if (row >= screen_Rows || col >= screen_Columns)
+    if (row >= screen_Rows || col >= screen_Columns || ScreenLines == NULL)
 	return;
 
     p = ScreenLines + LineOffset[row];
@@ -1367,7 +1371,7 @@
 {
     int	    i;
 
-    if (row >= screen_Rows)
+    if (row >= screen_Rows || ScreenLines == NULL)
 	return 0;
     for (i = screen_Columns; i > 0; i--)
 	if (ScreenLines[LineOffset[row] + i - 1] != ' ')
@@ -2432,7 +2436,8 @@
 #ifdef FEAT_FOLDING
     /* Remember the character under the mouse, it might be a '-' or '+' in the
      * fold column. */
-    if (row >= 0 && row < Rows && col >= 0 && col <= Columns)
+    if (row >= 0 && row < Rows && col >= 0 && col <= Columns
+						       && ScreenLines != NULL)
 	mouse_char = ScreenLines[LineOffset[row] + col];
     else
 	mouse_char = ' ';