Merge lp:~charlesk/hud/lp-1242032 into lp:hud/14.04

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 341
Merged at revision: 341
Proposed branch: lp:~charlesk/hud/lp-1242032
Merge into: lp:hud/14.04
Diff against target: 17 lines (+5/-2)
1 file modified
window-stack-bridge/BamfWindowStack.cpp (+5/-2)
To merge this branch: bzr merge lp:~charlesk/hud/lp-1242032
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+192893@code.launchpad.net

Description of the change

Add a nullptr safeguard to prevent a crash-on-null-ptr-reference.

Also, move a QMap lookup outside of a for loop. Yay!

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'window-stack-bridge/BamfWindowStack.cpp'
2--- window-stack-bridge/BamfWindowStack.cpp 2013-10-11 11:18:33 +0000
3+++ window-stack-bridge/BamfWindowStack.cpp 2013-10-28 16:16:04 +0000
4@@ -194,8 +194,11 @@
5 QStringList BamfWindowStack::GetWindowProperties(uint windowId,
6 const QString &appId, const QStringList &names) {
7 QStringList result;
8- for (const QString &name : names) {
9- result << m_windowsById[windowId]->xProp(name);
10+ const auto window = m_windowsById[windowId];
11+ if (window) {
12+ for (const QString &name : names) {
13+ result << window->xProp(name);
14+ }
15 }
16 return result;
17 }

Subscribers

People subscribed via source and target branches