~saviq/unity-scopes-api/fix-cross-wrap

« back to all changes in this revision

Viewing changes to src/scopes/internal/smartscopes/SmartScopesClient.cpp

  • Committer: Tarmac
  • Author(s): Marcus Tomlinson
  • Date: 2014-11-27 09:01:48 UTC
  • mfrom: (536.2.1 ss_fail_on_neg_version)
  • Revision ID: tarmac-20141127090148-lzrh3yyjnhujv39p
Skip remote scopes that return an invalid (negative) version number.

Approved by Michi Henning, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
            scope.invisible = child_node->has_node("invisible") ? child_node->get_node("invisible")->as_bool() : false;
284
284
 
285
285
            scope.version = child_node->has_node("version") ? child_node->get_node("version")->as_int() : 0;
 
286
            if (scope.version < 0)
 
287
            {
 
288
                std::cerr << "SmartScopesClient.get_remote_scopes(): Scope: \"" << scope.id
 
289
                          << "\" returned a negative \"version\" value" << std::endl;
 
290
                std::cerr << "SmartScopesClient.get_remote_scopes(): Skipping scope: \""
 
291
                          << scope.id << "\"" << std::endl;
 
292
                continue;
 
293
            }
286
294
 
287
295
            if (child_node->has_node("tags"))
288
296
            {