fix(gui): prevent nullptr dereference when VFS mode is unavailable - #10176
Conversation
nilsding
left a comment
There was a problem hiding this comment.
thanks for your contribution!
This change is treating the symptom (crash when activating VFS) rather than the cause (the VFS switch appearing at all). It would be better if the VFS toggle option is not shown at all when the plugin is not installed.
there is a check in AccountSettings which could be adapted to not show the VFS option if it's unavailable (i.e. mode is Vfs::Off)
desktop/src/gui/accountsettings.cpp
Line 772 in c866329
mgallien
left a comment
There was a problem hiding this comment.
nice find
please apply my fixes such that the code makes sense and do what is expected
the use of default by your code generator does not make sense and just rely on Q_UNREACHABLE letting the execution implicitly flow to the next statement of the select
I also assume that given the other VFS without the dialog use callback(true), you should also use it
|
I've changed so that execution doesn't reach the switch statement according to nilsding's suggestion. I agree this is a much better way to solve the problematic behavior that could appear on Tumbleweed. |
Prevent reaching a code path in Utility::askExperimentalVirtualFilesFeature that would cause a null pointer dereference. Assisted-by: Qwen:qwen-3.6-35b-a3b Signed-off-by: Troed S氓ngberg <[email protected]>
|
/backport to stable-34.0 please |
|
/backport to stable-33.0 please |
|
Artifact containing the AppImage: nextcloud-appimage-pr-10176.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. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Prevent reaching a code path in Utility::askExperimentalVirtualFilesFeature that would cause a null pointer dereference when the necessary libraries are not available. Adding the check for Vfs::Off to AccountSettings::slotCustomContextMenuRequested stops the option to enable vfs to appear altogether in such cases.
Assisted-by: Qwen:qwen-3.6-35b-a3b
Resolves
#10174
Summary
OpenSUSE Tumbleweed has a separate package for VFS. If the user tries to enable VFS without it the previous code dereferenced a null pointer and segfaulted. This fix prevents the user from enabling the option in that case.
TODO
Checklist
AI (if applicable)