We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 02b4ebd + 1a2a644 commit e9cb45eCopy full SHA for e9cb45e
src/AvaloniaEdit/Editing/TextArea.cs
@@ -1192,7 +1192,12 @@ public override string SurroundingText
1192
1193
public override TextSelection Selection
1194
{
1195
- get => new TextSelection(_textArea.Caret.Position.Column, _textArea.Caret.Position.Column + _textArea.Selection.Length);
+ get
1196
+ {
1197
+ if (_textArea == null)
1198
+ return new TextSelection(0, 0);
1199
+ return new TextSelection(_textArea.Caret.Position.Column, _textArea.Caret.Position.Column + _textArea.Selection.Length);
1200
+ }
1201
set
1202
1203
var selection = _textArea.Selection;
0 commit comments