summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/sql/connection.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/sql/connection.cc b/app/sql/connection.cc
index dd3756e..8f74e6e 100644
--- a/app/sql/connection.cc
+++ b/app/sql/connection.cc
@@ -264,6 +264,11 @@ const char* Connection::GetErrorMessage() const {
}
bool Connection::OpenInternal(const std::string& file_name) {
+ if (db_) {
+ NOTREACHED() << "sql::Connection is already open.";
+ return false;
+ }
+
int err = sqlite3_open(file_name.c_str(), &db_);
if (err != SQLITE_OK) {
OnSqliteError(err, NULL);