Skip to content

Commit 934bcd2

Browse files
authored
Merge pull request #105 from msladek/master
2 parents 0c57602 + a29c158 commit 934bcd2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/enpass/vault.go

+12
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ func (v *Vault) Initialize(databasePath string, keyfilePath string, password str
132132
return errors.Wrap(err, "could not open encrypted database")
133133
}
134134

135+
var tableName string
136+
err = v.db.QueryRow(`
137+
SELECT name
138+
FROM sqlite_master
139+
WHERE type='table' AND name='item'
140+
`).Scan(&tableName)
141+
if err != nil {
142+
return errors.Wrap(err, "could not connect to database")
143+
} else if tableName != "item" {
144+
return errors.New("could not connect to database")
145+
}
146+
135147
return nil
136148
}
137149

0 commit comments

Comments
 (0)