Skip to content

Commit

Permalink
Merge pull request #173 from chaoticgd/nodehandlefix
Browse files Browse the repository at this point in the history
Fix NodeHandle::lookup_node
  • Loading branch information
chaoticgd authored Feb 7, 2024
2 parents dc12f1c + 443a26d commit bea9045
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 bea9045

Please sign in to comment.