Skip to content

Commit edb5ccd

Browse files
Fixed NRE on FindPreviousLine
1 parent 49d77d8 commit edb5ccd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/LuaCodeView.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ string FindPreviousLine(UITextPosition from)
7575
range = GetTextRange(prefixPosition, from);
7676

7777
string text = TextInRange(range);
78+
79+
if (string.IsNullOrEmpty(text))
80+
return string.Empty;
81+
7882
if (text[0] == '\n')
7983
return text.Substring(1);
8084

0 commit comments

Comments
 (0)