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:30:42 +0100 |
commit | 0a8c2486dab278353febb4c50c9722779977227a (patch) | |
tree | 621c8732c6aad0b5a925a032ddec54655b00d9f1 | |
parent | 4956c3dc10bc856739c6371f048031543376090e (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. %%%%%%%%%%%%%%%%%%%% |