diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-03 21:33:04 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-03 21:33:04 +0200 |
commit | 544e08ab379fd53d00009a3400aa530520b65e85 (patch) | |
tree | 787bc332281d451d0790c13e693040e9e276d085 /common/storage_common.cpp | |
parent | 00efa772f1b39db010e480bddb08c2e086d7b364 (diff) | |
download | sink-544e08ab379fd53d00009a3400aa530520b65e85.tar.gz sink-544e08ab379fd53d00009a3400aa530520b65e85.zip |
Catch special error case of empty db name
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index f648c94..dfcfc2a 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -207,6 +207,11 @@ QByteArray DataStore::generateUid() | |||
207 | 207 | ||
208 | DataStore::NamedDatabase DataStore::mainDatabase(const DataStore::Transaction &t, const QByteArray &type) | 208 | DataStore::NamedDatabase DataStore::mainDatabase(const DataStore::Transaction &t, const QByteArray &type) |
209 | { | 209 | { |
210 | if (type.isEmpty()) { | ||
211 | SinkError() << "Tried to open main database for empty type."; | ||
212 | Q_ASSERT(false); | ||
213 | return {}; | ||
214 | } | ||
210 | return t.openDatabase(type + ".main"); | 215 | return t.openDatabase(type + ".main"); |
211 | } | 216 | } |
212 | 217 | ||