Skip to content

Commit

Permalink
Fix various null pointer segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Müller authored and fmoc committed Oct 26, 2022
1 parent 6b9f3da commit 3c694c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,18 +833,18 @@ void AccountSettings::slotAccountStateChanged()
this, &AccountSettings::slotAccountStateChanged,
Qt::UniqueConnection);

connect(_askForOAuthLoginDialog, &LoginRequiredDialog::rejected, [this]() {
connect(_askForOAuthLoginDialog, &LoginRequiredDialog::rejected, this, [this]() {
// if a user dismisses the dialog, we have no choice but signing them out
_accountState->signOutByUi();
});

connect(contentWidget, &OAuthLoginWidget::retryButtonClicked, this, [contentWidget, accountPtr = account]() {
connect(contentWidget, &OAuthLoginWidget::retryButtonClicked, _askForOAuthLoginDialog, [contentWidget, accountPtr = account]() {
auto creds = qobject_cast<HttpCredentialsGui *>(accountPtr->credentials());
creds->restartOAuth();
contentWidget->hideRetryFrame();
});

connect(cred, &HttpCredentialsGui::asked, this, [loginDialog = _askForOAuthLoginDialog, contentWidget, cred]() {
connect(cred, &HttpCredentialsGui::asked, _askForOAuthLoginDialog, [loginDialog = _askForOAuthLoginDialog, contentWidget, cred]() {
if (!cred->ready()) {
ocApp()->gui()->raiseDialog(loginDialog);
contentWidget->showRetryFrame();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/creds/httpcredentialsgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void HttpCredentialsGui::showDialog()
dialog->open();
ownCloudGui::raiseDialog(dialog);

QTimer::singleShot(0, [contentWidget]() {
QTimer::singleShot(0, contentWidget, [contentWidget]() {
contentWidget->setFocus(Qt::OtherFocusReason);
});

Expand Down

0 comments on commit 3c694c7

Please sign in to comment.