summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ast-base.cpp')
-rw-r--r--source/slang/slang-ast-base.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-ast-base.cpp b/source/slang/slang-ast-base.cpp
index 5b4a4ea0c..7fa0a8886 100644
--- a/source/slang/slang-ast-base.cpp
+++ b/source/slang/slang-ast-base.cpp
@@ -23,7 +23,7 @@ void NodeBase::_initDebug(ASTNodeType inAstNodeType, ASTBuilder* inAstBuilder)
DeclRefBase* Decl::getDefaultDeclRef()
{
auto astBuilder = getCurrentASTBuilder();
- if (astBuilder->getEpoch() != m_defaultDeclRefEpoch || !m_defaultDeclRef)
+ if (astBuilder && astBuilder->getEpoch() != m_defaultDeclRefEpoch || !m_defaultDeclRef)
{
m_defaultDeclRef = astBuilder->getOrCreate<DirectDeclRef>(this);
m_defaultDeclRefEpoch = astBuilder->getEpoch();