Skip to content

Commit 8ccfeb8

Browse files
Fixes null grid when moving from RIDE Log tab to Editor
1 parent 28cca64 commit 8ccfeb8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/robotide/editor/gridcolorizer.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ def colorize(self, selection_content):
3737
self._coloring_task(selection_content)
3838

3939
def _coloring_task(self, selection_content, row=0, col=0):
40-
if row >= self._grid.NumberRows:
41-
self._grid.ForceRefresh()
42-
elif col < self._grid.NumberCols:
43-
self._colorize_cell(row, col, selection_content)
44-
self._coloring_task(selection_content, row, col+1)
45-
else:
46-
self._coloring_task(selection_content, row+1, 0)
40+
if self._grid: # For example move from RIDE Log tab to Grid
41+
if row >= self._grid.NumberRows:
42+
self._grid.ForceRefresh()
43+
elif col < self._grid.NumberCols:
44+
self._colorize_cell(row, col, selection_content)
45+
self._coloring_task(selection_content, row, col+1)
46+
else:
47+
self._coloring_task(selection_content, row+1, 0)
4748

4849
def _colorize_cell(self, row, col, selection_content):
4950
cell_info = self._controller.get_cell_info(row, col)

0 commit comments

Comments
 (0)