Skip to content

Commit 08310eb

Browse files
authored
Merge pull request ethereum#15980 from henryhchchc/develop
Language Server: Fix hover crashes on invalid parameters
2 parents 597e5a9 + e13c612 commit 08310eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libsolidity/lsp/DocumentHoverHandler.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ void DocumentHoverHandler::operator()(MessageID _id, Json const& _args)
5959
{
6060
auto const [sourceUnitName, lineColumn] = HandlerBase(*this).extractSourceUnitNameAndLineColumn(_args);
6161
auto const [sourceNode, sourceOffset] = m_server.astNodeAndOffsetAtSourceLocation(sourceUnitName, lineColumn);
62+
if (!sourceNode)
63+
{
64+
client().reply(_id, Json());
65+
return;
66+
}
6267

6368
MarkdownBuilder markdown;
6469
auto rangeToHighlight = toRange(sourceNode->location());

0 commit comments

Comments
 (0)