mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
LibCpp: Don't include parameter type in FunctionType::to_string if null
The type of a function parameter can be null if we failed to parse it. In such a case, calling to_string() on a FunctionType node used to cause a null dereference. This caused the language server to crash when processing AK/StdLibExtraDetails.h
This commit is contained in:
parent
495a1be925
commit
e9de381607
1 changed files with 2 additions and 1 deletions
|
@ -124,7 +124,8 @@ String FunctionType::to_string() const
|
|||
first = false;
|
||||
else
|
||||
builder.append(", ");
|
||||
builder.append(parameter.type()->to_string());
|
||||
if (parameter.type())
|
||||
builder.append(parameter.type()->to_string());
|
||||
if (parameter.name() && !parameter.full_name().is_empty()) {
|
||||
builder.append(" ");
|
||||
builder.append(parameter.full_name());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue