Fix null-reference exception in TextAreaAutomationPeer - that was randomly occuring in the application.
This commit is contained in:
Родитель
f1e5677146
Коммит
09f7dec79b
|
@ -114,8 +114,11 @@ namespace ICSharpCode.AvalonEdit.Editing
|
|||
return this;
|
||||
if (patternInterface == PatternInterface.Scroll) {
|
||||
TextEditor editor = TextArea.GetService(typeof(TextEditor)) as TextEditor;
|
||||
if (editor != null)
|
||||
return FromElement(editor).GetPattern(patternInterface);
|
||||
if (editor != null) {
|
||||
var fromElement = FromElement(editor);
|
||||
if (fromElement != null)
|
||||
fromElement.GetPattern(patternInterface);
|
||||
}
|
||||
}
|
||||
return base.GetPattern(patternInterface);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче