about summary refs log tree commit diff
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 89cee32ba4a9..64f9813a400f 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); }