Permalink
Browse files

Mythweather - If for some reason the screen doesn't exist in the DB t…

…hen we need to abort the save or insert bogus entries.
  • Loading branch information...
stuartm committed Jul 27, 2012
1 parent e4f9288 commit 04715f641349e8da25c8232efa6867e17b0be3fa
Showing with 2 additions and 3 deletions.
  1. +2 −3 mythplugins/mythweather/mythweather/weatherSetup.cpp
@@ -446,14 +446,13 @@ void ScreenSetup::saveData()
db2.prepare(query2);
db2.bindValue(":DRAW", draworder);
db2.bindValue(":HOST", gCoreContext->GetHostName());
- if (!db2.exec())
+ if (!db2.exec() || !db2.next())
{
LOG(VB_GENERAL, LOG_ERR, db2.executedQuery());
LOG(VB_GENERAL, LOG_ERR, db2.lastError().text());
return;
}
-
- db2.next();
+
int screen_id = db2.value(0).toInt();
query2 = "INSERT INTO weatherdatalayout (location, dataitem, "

0 comments on commit 04715f6

Please sign in to comment.