Skip to content

Commit

Permalink
Mythweather - If for some reason the screen doesn't exist in the DB t…
Browse files Browse the repository at this point in the history
…hen we need to abort the save or insert bogus entries.
  • Loading branch information
stuartm committed Jul 27, 2012
1 parent e4f9288 commit 04715f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mythplugins/mythweather/mythweather/weatherSetup.cpp
Expand Up @@ -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, "
Expand Down

0 comments on commit 04715f6

Please sign in to comment.