@@ -165,6 +165,10 @@ func (d *Database) Read(tableName string, key string, assignee interface{}) erro
func (d *Database) KeyExists(tableName string, key string) bool {
resultIsNil := false
+ if !d.TableExists(tableName) {
+ //Table not exists. Do not proceed accessing key
+ return false
+ }
err := d.Db.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte(tableName))
v := b.Get([]byte(key))