Skip to content
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

Fix crashing when selecting user status and predefined statuses not appearing #4616

Merged
merged 2 commits into from
Jun 24, 2022

Conversation

claucambra
Copy link
Collaborator

@claucambra claucambra commented Jun 7, 2022

Previously, the signal handler for opening the user status selector dialog would try to trigger the loading of the selected user's user status connector for the user status selector model before the dialog had finished loading. This would cause the loading to never be triggered and the pointer to remain null, which, combined with the lack of a check for a null pointer, would cause a crash.

This PR fixes the user status connector loading behaviour to not be subject to this race condition, and adds checks for the null pointer in the user status selector model.

EDIT: upon testing this PR also fixes an issue where predefined statuses don't appear the first time the user status selector is invoked

@claucambra claucambra force-pushed the bugfix/user-status-selector-crash branch from bb0b299 to 77bc7cf Compare June 7, 2022 16:59
@claucambra claucambra self-assigned this Jun 9, 2022
@claucambra claucambra force-pushed the bugfix/user-status-selector-crash branch 2 times, most recently from e69331e to a0c5647 Compare June 10, 2022 08:42
@claucambra claucambra changed the title Fix crashing when selecting user status Fix crashing when selecting user status and predefined statuses not appearing Jun 17, 2022
@mgallien mgallien force-pushed the bugfix/user-status-selector-crash branch from 8c797e0 to ceeb255 Compare June 24, 2022 06:20
@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

Merging #4616 (ceeb255) into master (5337d4b) will not change coverage.
The diff coverage is n/a.

❗ Current head ceeb255 differs from pull request most recent head 0658d72. Consider uploading reports for the commit 0658d72 to get more accurate results

@@           Coverage Diff           @@
##           master    #4616   +/-   ##
=======================================
  Coverage   56.42%   56.42%           
=======================================
  Files         138      138           
  Lines       17071    17071           
=======================================
  Hits         9632     9632           
  Misses       7439     7439           

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
@claucambra claucambra force-pushed the bugfix/user-status-selector-crash branch from ceeb255 to 0658d72 Compare June 24, 2022 10:34
@sonarcloud
Copy link

sonarcloud bot commented Jun 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-4616-0658d7227ee3fea8ef8e3c5dc4da0e4cde59ecc3-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@claucambra claucambra merged commit d23305f into master Jun 24, 2022
@claucambra claucambra deleted the bugfix/user-status-selector-crash branch June 24, 2022 11:44
@mgallien mgallien added this to the 3.6.0 milestone Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants