Skip to content

Commit f77f95b

Browse files
authored
Merge pull request #87 from fcojavmc/fix-coredump
BUG: Instrospection query with non-valid type name crashes
2 parents 2379843 + 517cb85 commit f77f95b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Introspection.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ void Schema::AddType(response::StringType&& name, std::shared_ptr<object::Type>
3232

3333
const std::shared_ptr<object::Type>& Schema::LookupType(const response::StringType& name) const
3434
{
35+
if (_typeMap.find(name) == _typeMap.cend())
36+
{
37+
throw service::schema_exception { { "type not found" } };
38+
}
39+
3540
return _types[_typeMap.find(name)->second].second;
3641
}
3742

0 commit comments

Comments
 (0)