aboutsummaryrefslogtreecommitdiff
path: root/src/db.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.cc')
-rw-r--r--src/db.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/db.cc b/src/db.cc
index 89cee32ba..64f9813a4 100644
--- a/src/db.cc
+++ b/src/db.cc
@@ -65,7 +65,10 @@ bool queryDB(const string & filename, const string & dbname,
err = db->get(0, &kt, &dt, 0);
if (err) return false;
- data = string((char *) dt.get_data(), dt.get_size());
+ if (!dt.get_data())
+ data = "";
+ else
+ data = string((char *) dt.get_data(), dt.get_size());
} catch (DbException e) { rethrow(e); }