diff options
author | Christian Dywan <christian.dywan@canonical.com> | 2013-12-19 20:58:53 +0100 |
---|---|---|
committer | Christian Dywan <christian.dywan@canonical.com> | 2013-12-19 20:58:53 +0100 |
commit | d6ac0c16ab04c04d8e88b3eac8e1edf498d9da8d (patch) | |
tree | b9643e9632fc519ef5de92cdd145b15bebb9ba1e | |
parent | c63a117cd81270cd932e32cfdb277973f23c2bf2 (diff) | |
download | midori-d6ac0c16ab04c04d8e88b3eac8e1edf498d9da8d.tar.gz |
Handle Sqlite.NULL in DatabaseStatement.get_int64
-rw-r--r-- | midori/midori-database.vala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/midori/midori-database.vala b/midori/midori-database.vala index cb586b89..e19fede4 100644 --- a/midori/midori-database.vala +++ b/midori/midori-database.vala @@ -105,8 +105,10 @@ namespace Midori { */ public int64 get_int64 (string name) throws DatabaseError { int index = column_index (name); - if (stmt.column_type (index) != Sqlite.INTEGER) - throw new DatabaseError.TYPE ("Getting '%s' with wrong type in row: %s".printf (name, query)); + int type = stmt.column_type (index); + if (type != Sqlite.INTEGER && type != Sqlite.NULL) + throw new DatabaseError.TYPE ("Getting '%s' with value '%s' of wrong type %d in row: %s".printf ( + name, stmt.column_text (index), type, query)); return stmt.column_int64 (index); } |