Skip to content

Commit

Permalink
Fix possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Sep 14, 2021
1 parent f9ce335 commit e698d56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/9012
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: We fixed a crash when using the retry action on an issue

Using the context menu action on a sync issue could cause a crash.

https://github.com/owncloud/client/issues/9013
https://github.com/owncloud/client/pull/9012
8 changes: 5 additions & 3 deletions src/gui/protocolwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ void ProtocolWidget::showContextMenu(QWidget *parent, ProtocolItemModel *model,
case SyncFileItem::SoftError:
Q_FALLTHROUGH();
case SyncFileItem::BlacklistedError:
menu->addAction(tr("Retry sync"), parent, [&data] {
data.folder()->journalDb()->wipeErrorBlacklistEntry(data.path());
FolderMan::instance()->scheduleFolderNext(data.folder());
menu->addAction(tr("Retry sync"), parent, [data, folder = QPointer<Folder>(data.folder())] {
if (folder) {
folder->journalDb()->wipeErrorBlacklistEntry(data.path());
FolderMan::instance()->scheduleFolderNext(folder);
}
});
default:
break;
Expand Down

0 comments on commit e698d56

Please sign in to comment.