Skip to content

Commit

Permalink
Do not crash in case of empty data (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoaloi committed Dec 15, 2022
1 parent 2c17eae commit 1a66e87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/els_lsp/src/els_code_actions.erl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ remove_macro(Uri, Range, _Data, [Macro]) ->
end.

-spec remove_unused(uri(), range(), binary(), [binary()]) -> [map()].
remove_unused(_Uri, _Range0, <<>>, [_Import]) ->
[];
remove_unused(Uri, _Range0, Data, [Import]) ->
{ok, Document} = els_utils:lookup_document(Uri),
case els_range:inclusion_range(Data, Document) of
Expand Down

0 comments on commit 1a66e87

Please sign in to comment.