Skip to content

Commit b139e39

Browse files
authored
Add null check in OnIndentSelection()
Add null check for IndentationStrategy. If this is null (not common, but can legitimately be null), pressing Ctrl+I will crash.
1 parent 91eb4bc commit b139e39

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ static string InvertCase(string text)
641641
static void OnIndentSelection(object target, ExecutedRoutedEventArgs args)
642642
{
643643
TextArea textArea = GetTextArea(target);
644-
if (textArea != null && textArea.Document != null) {
644+
if (textArea != null && textArea.Document != null && textArea.IndentationStrategy != null) {
645645
using (textArea.Document.RunUpdate()) {
646646
int start, end;
647647
if (textArea.Selection.IsEmpty) {

0 commit comments

Comments
 (0)