Skip to content

Commit 6f24c1d

Browse files
authored
Merge pull request #239 from sloutsky/textarea_automation_peer_fix
Fix null-reference exception in TextAreaAutomationPeer
2 parents 113d1f1 + 3dbd960 commit 6f24c1d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ICSharpCode.AvalonEdit/Editing/TextAreaAutomationPeer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ public override object GetPattern(PatternInterface patternInterface)
114114
return this;
115115
if (patternInterface == PatternInterface.Scroll) {
116116
TextEditor editor = TextArea.GetService(typeof(TextEditor)) as TextEditor;
117-
if (editor != null)
118-
return FromElement(editor).GetPattern(patternInterface);
117+
if (editor != null) {
118+
var fromElement = FromElement(editor);
119+
if (fromElement != null)
120+
return fromElement.GetPattern(patternInterface);
121+
}
119122
}
120123
return base.GetPattern(patternInterface);
121124
}

0 commit comments

Comments
 (0)