Check parent variable nullness in folderstatusmodel

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-03-03 18:04:47 +08:00
parent 0daec2071e
commit c7c34b9f14

View file

@ -956,8 +956,7 @@ void FolderStatusModel::slotApplySelectiveSync()
void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
{
const auto parent = qobject_cast<QWidget *>(QObject::parent());
if (!parent->isVisible()) {
if (const auto parent = qobject_cast<QWidget *>(QObject::parent()); !parent || !parent->isVisible()) {
return; // for https://github.com/owncloud/client/issues/2648#issuecomment-71377909
}