Skip to content

Commit 9bf6b2e

Browse files
committed
fix crash when end line could not be found
1 parent a78f3c5 commit 9bf6b2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/language_server/lib/language_server/providers/document_symbols.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ defmodule ElixirLS.LanguageServer.Providers.DocumentSymbols do
495495
if parent_end_line > parent_do_line do
496496
# take end location from parent and assume end_of_expression is last char in previous line
497497
end_of_expression =
498-
Enum.at(lines, max(parent_end_line - 2, 0))
498+
(Enum.at(lines, max(parent_end_line - 2, 0)) || "")
499499
|> String.length()
500500

501501
SourceFile.elixir_position_to_lsp(

0 commit comments

Comments
 (0)