-
Notifications
You must be signed in to change notification settings - Fork 899
fix: prevent crash when changing proxy settings with logged out account #9194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Rello <13385119+Rello@users.noreply.github.com>
Co-authored-by: Rello <13385119+Rello@users.noreply.github.com>
Co-authored-by: Rello <13385119+Rello@users.noreply.github.com>
8ba1128 to
eeae7ba
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-9194.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
| // When proxy settings are changed, saveProxySettings() will try to | ||
| // get accountState from AccountManager, which will return nullptr | ||
| // This test ensures the app doesn't crash in that scenario | ||
| NetworkSettings settings(account); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot this is not enough to get the test to run the modified code in NetworkSettings class
can you also modify the settings and get them saved to ensure we run the modified code ?




Description
The desktop client segfaults when proxy settings are changed while an account is logged out.
AccountManager::accountFromUserId()returnsnullptrfor logged-out accounts, butNetworkSettings::saveProxySettings()dereferences it unconditionally.Changes
src/gui/networksettings.cpp
freshConnectionAttempt()on accountState returned byaccountFromUserId()test/testnetworksettings.cpp (new)
test/CMakeLists.txt
Impact
Proxy settings save correctly regardless of account state. Connection attempt skipped when accountState unavailable.
Signed-off-by: Copilot 198982749+Copilot@users.noreply.github.com
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.