diff options
author | Magnus Ahltorp <map@kth.se> | 2015-02-19 12:03:14 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-02-19 12:08:13 +0100 |
commit | 2067d851f39251be6a876ab172586d008e085f40 (patch) | |
tree | ed77ccab52acd970c4b9e030d1979cfc2f5a8427 | |
parent | b1849d0a40a6b44400bf0a833bf03b3ceb659c9b (diff) |
db:get_by_entry_hash: Check that entry exists
-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. %%%%%%%%%%%%%%%%%%%% |