summaryrefslogtreecommitdiffstats
path: root/src/storage/ngram_kyotodb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage/ngram_kyotodb.cpp')
-rw-r--r--src/storage/ngram_kyotodb.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/storage/ngram_kyotodb.cpp b/src/storage/ngram_kyotodb.cpp
index 1cb72f4..f2771ca 100644
--- a/src/storage/ngram_kyotodb.cpp
+++ b/src/storage/ngram_kyotodb.cpp
@@ -141,6 +141,9 @@ bool Bigram::load(phrase_token_t index, SingleGram * & single_gram){
const char * kbuf = (char *) &index;
const int32_t vsiz = m_db->check(kbuf, sizeof(phrase_token_t));
+ /* -1 on failure. */
+ if (-1 == vsiz)
+ return false;
m_chunk.set_size(vsiz);
char * vbuf = (char *) m_chunk.begin();