Merge lp:~ken-vandine/content-hub/no_unknown into lp:content-hub

Proposed by Ken VanDine
Status: Merged
Approved by: Ken VanDine
Approved revision: 142
Merged at revision: 84
Proposed branch: lp:~ken-vandine/content-hub/no_unknown
Merge into: lp:content-hub
Prerequisite: lp:~ken-vandine/content-hub/quiet_logging
Diff against target: 24 lines (+7/-0)
1 file modified
src/com/ubuntu/content/service/registry.cpp (+7/-0)
To merge this branch: bzr merge lp:~ken-vandine/content-hub/no_unknown
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+212215@code.launchpad.net

Commit message

  protect against queries for Type::unknown

Description of the change

  protect against queries for Type::unknown

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Are there any related MPs required for this MP to build/function as expected?
 * No (besides the prerequisite branch included)
Is your branch in sync with latest trunk
 * Yes
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
 * Yes
Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/content-hub) on device or emulator?
 * Yes
If you changed the UI, was the change specified/approved by design?
 * No UI changes
If you changed the packaging (debian), did you subscribe a core-dev to this MP?
 * No packaging changes

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?

 * Yes

Did CI run pass? If not, please explain why.

 * Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?

 * Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/com/ubuntu/content/service/registry.cpp'
2--- src/com/ubuntu/content/service/registry.cpp 2014-03-21 17:55:30 +0000
3+++ src/com/ubuntu/content/service/registry.cpp 2014-03-21 17:55:30 +0000
4@@ -130,6 +130,10 @@
5 void Registry::enumerate_known_destinations_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each)
6 {
7 TRACE() << Q_FUNC_INFO << type.id();
8+
9+ if (type == cuc::Type::unknown())
10+ return;
11+
12 Q_FOREACH (QString k, m_dests->get(type.id()).toStringList())
13 {
14 TRACE() << Q_FUNC_INFO << k;
15@@ -141,6 +145,9 @@
16 {
17 TRACE() << Q_FUNC_INFO << type.id();
18
19+ if (type == cuc::Type::unknown())
20+ return;
21+
22 Q_FOREACH (QString k, m_shares->get(type.id()).toStringList())
23 {
24 TRACE() << Q_FUNC_INFO << k;

Subscribers

People subscribed via source and target branches