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

Prevent crashing when trying to create error-ing QML component in systray.cpp, output error to log #4850

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

claucambra
Copy link
Collaborator

At the moment if we try to create a QML component (such as the call notification dialog) in systray.cpp which has an error, the client crashes.

When we try to open the tray window, the client does not crash, but it always provides a generic and unhelpful "QQMLApplicationEngine failed to load component" error.

This PR fixes both of these issues by checking QQmlComponents for errors before trying to create them, and logging the error message if there is one.

Signed-off-by: Claudio Cambra claudio.cambra@gmail.com

@claucambra claucambra self-assigned this Aug 16, 2022
@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #4850 (6746717) into master (6746717) will not change coverage.
The diff coverage is n/a.

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

@@           Coverage Diff           @@
##           master    #4850   +/-   ##
=======================================
  Coverage   57.21%   57.21%           
=======================================
  Files         138      138           
  Lines       17144    17144           
=======================================
  Hits         9809     9809           
  Misses       7335     7335           

…tray.cpp, output error to log

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
@claucambra claucambra force-pushed the bugfix/qml-error-logging-cpp branch from 0b2829d to fc5e9db Compare August 17, 2022 13:31
@sonarcloud
Copy link

sonarcloud bot commented Aug 17, 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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-4850-fc5e9db839cb07e3d3ab8c5837d9203106ad200d-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 d44d839 into master Aug 17, 2022
@claucambra claucambra deleted the bugfix/qml-error-logging-cpp branch August 17, 2022 18:01
@mgallien mgallien added this to the 3.6.0 milestone Sep 2, 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.

5 participants