~thomas-voss/location-service/add_controller_and_service_configuration

« back to all changes in this revision

Viewing changes to src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.h

  • Committer: thomas-voss
  • Date: 2014-06-12 20:00:33 UTC
  • Revision ID: thomas.voss@canonical.com-20140612200033-6msggu6ke2imvu0e
Make sure that missing last_seen property is not fatal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include <com/ubuntu/location/connectivity/wireless_network.h>
22
22
 
 
23
#include <com/ubuntu/location/logging.h>
 
24
 
23
25
#include "nm.h"
24
26
 
25
27
namespace
93
95
        : device_(device),
94
96
          access_point_(ap)
95
97
    {
96
 
        last_seen_ = std::chrono::system_clock::time_point
97
 
        {
98
 
            std::chrono::system_clock::duration{access_point_.last_seen->get()}
99
 
        };
 
98
        try
 
99
        {
 
100
            last_seen_ = std::chrono::system_clock::time_point
 
101
            {
 
102
                std::chrono::system_clock::duration{access_point_.last_seen->get()}
 
103
            };
 
104
        } catch(const std::exception& e)
 
105
        {
 
106
            LOG(WARNING) << e.what();
 
107
        }
100
108
 
101
109
        bssid_ = access_point_.hw_address->get();
102
110
        ssid_ = utf8_ssid_to_string(access_point_.ssid->get());