diff options
author | Magnus Ahltorp <map@kth.se> | 2015-02-19 12:03:14 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2015-02-27 02:29:17 +0100 |
commit | 9384cd1389ebfb8ea3193e0027e40e9b2db1bc88 (patch) | |
tree | 285e14bbaa62caf94c0a771a0f15f2505be39f0b /src | |
parent | 0e19b2c56ee6b7819b0993a3a2e74e8838dc1014 (diff) |
db:get_by_entry_hash: Check that entry exists
Diffstat (limited to 'src')
-rw-r--r-- | src/db.erl | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -91,9 +91,13 @@ get_by_entry_hash(EntryHash) -> noentry -> notfound; LeafHash -> - Entry = entry_for_leafhash(LeafHash), - %% Don't fetch index, isn't used and might not exist - {notfetched, LeafHash, Entry} + case entry_for_leafhash(LeafHash) of + noentry -> + notfound; + Entry -> + %% Don't fetch index, isn't used and might not exist + {notfetched, LeafHash, Entry} + end end. %%%%%%%%%%%%%%%%%%%% |