Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table.cs: Fixed possible NullRef Exception #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Models/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8127,7 +8127,7 @@ protected void OnPaintCell(PaintEventArgs e, int row, int column, Rectangle cell
}
}

if (column < currentRow.Cells.Count)
if (currentRow?.Cells != null && column < currentRow.Cells.Count)
{
// is the cell selected
bool isSelected = false;
Expand All @@ -8145,12 +8145,10 @@ protected void OnPaintCell(PaintEventArgs e, int row, int column, Rectangle cell
isSelected = true;
}
}
else if (this.SelectionStyle == SelectionStyle.Grid)
else if (this.SelectionStyle == SelectionStyle.Grid &&
this.TableModel.Selections.IsCellSelected(row, column))
{
if (this.TableModel.Selections.IsCellSelected(row, column))
{
isSelected = true;
}
isSelected = true;
}
}

Expand Down