summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-04-23 10:54:43 -0700
committerGitHub <noreply@github.com>2021-04-23 10:54:43 -0700
commitff1d19079fb789a4d64ee16b3212491fdff9bf9a (patch)
treeb19a16004c025f3da73778cee5d14690c68ac622 /source
parent79e722338cd59aab74b4c57600c5ac6bce3bcd25 (diff)
Fix `model-viewer` crash when using Vulkan. (#1804)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-reflection-api.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp
index eb1514f4c..e68efde06 100644
--- a/source/slang/slang-reflection-api.cpp
+++ b/source/slang/slang-reflection-api.cpp
@@ -1397,7 +1397,7 @@ namespace Slang
TypeLayout::ExtendedInfo::SubObjectRangeInfo subObjectRange;
subObjectRange.bindingRangeIndex = bindingRangeIndex;
subObjectRange.spaceOffset = 0;
- if (kind == LayoutResourceKind::RegisterSpace)
+ if (kind == LayoutResourceKind::RegisterSpace && path)
{
auto resInfo = path->var->FindResourceInfo(LayoutResourceKind::RegisterSpace);
subObjectRange.spaceOffset = resInfo->index;