Merge lp:~mardy/ubuntu-system-settings-online-accounts/invalid-provider-1554254 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan on 2016-03-08
Status: Merged
Approved by: David Barth on 2016-03-08
Approved revision: 332
Merged at revision: 337
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/invalid-provider-1554254
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 14 lines (+4/-0)
1 file modified
plugins/OnlineAccountsPlugin/application-manager.cpp (+4/-0)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/invalid-provider-1554254
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing on 2016-03-08
Online Accounts 2016-03-08 Pending
Review via email: mp+288372@code.launchpad.net

Commit message

Don't crash on invalid providers

Description of the change

Don't crash on invalid providers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/OnlineAccountsPlugin/application-manager.cpp'
2--- plugins/OnlineAccountsPlugin/application-manager.cpp 2015-09-24 12:58:34 +0000
3+++ plugins/OnlineAccountsPlugin/application-manager.cpp 2016-03-08 08:05:08 +0000
4@@ -188,6 +188,10 @@
5 {
6 Accounts::Provider provider =
7 AccountManager::instance()->provider(providerId);
8+ if (Q_UNLIKELY(!provider.isValid())) {
9+ qWarning() << "Invalid provider" << providerId;
10+ return QVariantMap();
11+ }
12
13 QVariantMap info;
14 info.insert(QStringLiteral("id"), providerId);

Subscribers

People subscribed via source and target branches