diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-reflection.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/slang/slang-reflection.cpp b/source/slang/slang-reflection.cpp index c0c5bd72f..037bc2d97 100644 --- a/source/slang/slang-reflection.cpp +++ b/source/slang/slang-reflection.cpp @@ -598,8 +598,15 @@ SLANG_API SlangReflectionType * spReflection_FindTypeByName(SlangReflection * re Slang::DiagnosticSink sink( programLayout->getTargetReq()->getLinkage()->getSourceManager()); - RefPtr<Type> result = program->getTypeFromString(name, &sink); - return (SlangReflectionType*)result.Ptr(); + try + { + RefPtr<Type> result = program->getTypeFromString(name, &sink); + return (SlangReflectionType*)result.Ptr(); + } + catch( ... ) + { + return nullptr; + } } SLANG_API SlangReflectionTypeLayout* spReflection_GetTypeLayout( |
