Skip to content

Commit

Permalink
Add a null check for the DataGridView instance before calling the…
Browse files Browse the repository at this point in the history
… `NotifyMSAAClient` method.

Fixes #12752

## Root Cause

- The issue occurs because the `NotifyMSAAClient` method is called
without checking if the `DataGridView` instance is `null`. This leads to
a potential `NullReferenceException`.

## Proposed changes

- Add a `null` check for the `DataGridView` instance before calling the
`NotifyMSAAClient` method.

## Customer Impact

- Prevents runtime crashes when the `DataGridView` is `null`.

## Regression?

- No

## Risk

- Minimal

## Screenshots

### Before

### After

## Test methodology

- Manual testing

## Test environment(s)

- `10.0.100-alpha.1.25064.3`
  • Loading branch information
Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) committed Jan 22, 2025
1 parent 77ec5c9 commit 95f04dc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,10 @@ protected override void OnKeyUp(KeyEventArgs e, int rowIndex)
e.Handled = true;
}

NotifyMSAAClient(ColumnIndex, rowIndex);
if (DataGridView is not null)
{
NotifyMSAAClient(ColumnIndex, rowIndex);
}
}
}

Expand Down

0 comments on commit 95f04dc

Please sign in to comment.