Skip to content

Commit

Permalink
Fix accessing null cache
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 committed Jul 15, 2018
1 parent ca6518e commit 305f1c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/shogun/features/DenseFeatures.cpp
Expand Up @@ -124,10 +124,13 @@ template<class ST> ST* CDenseFeatures<ST>::get_feature_vector(int32_t num, int32
else
{
if (feature_cache)
{
feat = feature_cache->lock_entry(real_num);

if (!feat)
feat = feature_cache->set_entry(real_num);
if (!feat)
feat = feature_cache->set_entry(real_num);
}

if (!feat)
{
dofree = true;
Expand Down

0 comments on commit 305f1c0

Please sign in to comment.