mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Fix infinite loop when propagateFolderUpdatesToParent is invoked using the root folder
This commit is contained in:
@ -731,7 +731,7 @@ void DBHelper::propagateFolderUpdatesToParent(const Folder &folder, QSqlDatabase
|
||||
{
|
||||
auto currentParentId = folder.parentId;
|
||||
auto currentId = folder.id;
|
||||
while (currentParentId != 1) {
|
||||
while (currentParentId != 1 && currentParentId != 0) { // currentParentId is 0 if `folder` is the root folder
|
||||
auto f = loadFolder(currentParentId, db);
|
||||
currentParentId = f.parentId;
|
||||
currentId = f.id;
|
||||
|
Reference in New Issue
Block a user