Skip to content

Commit

Permalink
Fix NodeHandle::lookup_node
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd committed Feb 7, 2024
1 parent dc12f1c commit 443a26d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ccc/symbol_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,11 @@ const MultiSymbolHandle& NodeHandle::symbol() const

const ast::Node* NodeHandle::lookup_node(const SymbolDatabase& database) const
{
const Symbol* symbol = m_symbol.lookup_symbol(database);
if(!symbol || symbol->generation() != m_generation) {
return nullptr;
if(m_symbol.valid()) {
const Symbol* symbol = m_symbol.lookup_symbol(database);
if(!symbol || symbol->generation() != m_generation) {
return nullptr;
}
}
return m_node;
}
Expand Down

0 comments on commit 443a26d

Please sign in to comment.