mirror of https://github.com/KDE/kasts.git
On startup, remove feed entries with empty URL on startup
This should never happen, but occasionally did when something went wrong while adding a new feed, e.g. a crash. This would then cause a segfault on startup. BUG: 495961
This commit is contained in:
parent
ceb919ba63
commit
aa9bbc1bdb
|
@ -348,5 +348,10 @@ void Database::setWalMode()
|
|||
|
||||
void Database::cleanup()
|
||||
{
|
||||
// TODO: create database sanity checks, or, alternatively, create database scrub routine
|
||||
// delete rows with empty feed urls, as this should never happen, but could
|
||||
// occur when something goes wrong (like a crash) when trying to add a new
|
||||
// feed
|
||||
QSqlQuery query;
|
||||
query.prepare(QStringLiteral("DELETE FROM Feeds WHERE url is NULL or url='';"));
|
||||
execute(query);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue