diff options
author | Lloyd Sheng <i@lloydsheng.com> | 2018-06-20 11:52:26 +0800 |
---|---|---|
committer | Lloyd Sheng <i@lloydsheng.com> | 2018-06-20 11:52:26 +0800 |
commit | d05df1b92e1d86472051cf358f73428bbf73b3a7 (patch) | |
tree | 230ee1e545c1f1ddb1ae94056bbebc95f9127947 | |
parent | 4cd656135f57e6ccba8d457fac3a87763a548678 (diff) | |
download | qtlocation-mapboxgl-upstream/lloyd-tile-timing.tar.gz |
Fix crash issue if onlineResponse.data is nullupstream/lloyd-tile-timing
-rw-r--r-- | platform/default/default_file_source.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/default/default_file_source.cpp b/platform/default/default_file_source.cpp index eade68ede8..89aabeb8d3 100644 --- a/platform/default/default_file_source.cpp +++ b/platform/default/default_file_source.cpp @@ -156,10 +156,11 @@ public: tasks[req] = onlineFileSource.request(resource, [=] (Response onlineResponse) mutable { this->offlineDatabase->put(resource, onlineResponse); if (resource.kind == Resource::Kind::Tile) { + // onlineResponse.data will be null if data not modified MBGL_TIMING_FINISH(watch, " Action: " << "Requesting," << " URL: " << resource.url.c_str() << - " Size: " << onlineResponse.data->size() << "B," << + " Size: " << (onlineResponse.data != nullptr ? onlineResponse.data->size() : 0) << "B," << " Time") } callback(onlineResponse); |