Skip to content

Commit 1e0d0dd

Browse files
authored
GetPattern Null check supporting columns without Datagridowner (#8477)
* adding Null Check * Code Formatting
1 parent 616a2cc commit 1e0d0dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DataGridCellItemAutomationPeer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public override object GetPattern(PatternInterface patternInterface)
255255
switch (patternInterface)
256256
{
257257
case PatternInterface.Invoke:
258-
if (!this.OwningDataGrid.IsReadOnly && !_column.IsReadOnly)
258+
if (this.OwningDataGrid != null && !this.OwningDataGrid.IsReadOnly && !_column.IsReadOnly)
259259
{
260260
return this;
261261
}

0 commit comments

Comments
 (0)