From 8af4fca9ded844423d2bbdd892fd7a071e0b8dd6 Mon Sep 17 00:00:00 2001 From: halvarsson Date: Thu, 9 May 2024 12:02:42 +0200 Subject: [PATCH] add fix for null exception on autocomplete --- Autocomplete/PowershellAutocomplete.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Autocomplete/PowershellAutocomplete.cs b/Autocomplete/PowershellAutocomplete.cs index dd99c9c..a44921d 100644 --- a/Autocomplete/PowershellAutocomplete.cs +++ b/Autocomplete/PowershellAutocomplete.cs @@ -58,7 +58,10 @@ private void TryGenerateSuggestions(int columnOffset = 0) } else { - offset += host.Runes[lineOffset].Count + Environment.NewLine.Length; + if (host.Runes != null) + { + offset += host.Runes[lineOffset].Count + Environment.NewLine.Length; + } } } var text = host.Text.ToString();