Fix SIGSEGV in StringHashTable if such key is not exists

This commit is contained in:
Azat Khuzhin 2020-05-13 03:32:09 +03:00
parent c811e1f0d0
commit e102ad373a

View File

@ -333,7 +333,11 @@ public:
template <typename Submap, typename SubmapKey>
auto ALWAYS_INLINE operator()(Submap & map, const SubmapKey & key, size_t hash)
{
return &map.find(key, hash)->getMapped();
auto it = map.find(key, hash);
if (!it)
return decltype(&it->getMapped()){};
else
return &it->getMapped();
}
};