Skip to content

Commit

Permalink
check if result is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
shinohara-rin committed May 6, 2024
1 parent 7958ff2 commit eaddd67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/language_server/lib/language_server/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ defmodule ElixirLS.LanguageServer.Server do
{:ok, result} =
Definition.definition(uri, parser_context, line, character, state.project_dir)

if result.uri == uri && result.range["start"]["line"] == line - 1 do
if result != nil && result.uri == uri && result.range["start"]["line"] == line - 1 do
case References.references(parser_context, uri, line, character, false, state.project_dir) do
[] -> {:ok, result}
refs -> {:ok, refs}
Expand Down

0 comments on commit eaddd67

Please sign in to comment.