summaryrefslogtreecommitdiffstats
path: root/smdirwatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r--smdirwatcher.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp
index 3fec952..46ec905 100644
--- a/smdirwatcher.cpp
+++ b/smdirwatcher.cpp
@@ -98,7 +98,11 @@ int SmDirWatcher::presenceData(QString &md5){
QSqlQuery present1Q(mDb);
present1Q.prepare("SELECT COUNT(*) FROM files WHERE cmd5sum = :md5");
present1Q.bindValue(":md5", md5);
- present1Q.exec();
+ if(!present1Q.exec()){
+ mDb.close();
+ mDb.open();
+ return SmDirModel::InNone;
+ }
while(present1Q.next()){
int c = present1Q.value(0).toInt();
if(c > 0){