Browse Source

Added extra boundary check before rendering

Thomas Nind 4 years ago
parent
commit
c2c96931c4
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Terminal.Gui/Views/TableView.cs

+ 4 - 2
Terminal.Gui/Views/TableView.cs

@@ -428,8 +428,10 @@ namespace Terminal.Gui {
 						Driver.SetAttribute (Driver.MakeAttribute (cellColor.Background, cellColor.Foreground));
 						Driver.AddRune (render [0]);
 
-						Driver.SetAttribute (cellColor);
-						Driver.AddStr (render.Substring (1));
+						if (render.Length > 1) {
+							Driver.SetAttribute (cellColor);
+							Driver.AddStr (render.Substring (1));
+						}
 					}
 				}
 				else {