summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-03-28 14:38:11 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-03-28 21:31:35 +0300
commitb3ffeceb9e0077fc81330a411a2ae1b590ec8dd6 (patch)
treef8098d50881373942297298272fff5296fac8144
parent47c1e42ac1073ef02093b59336588f389f287227 (diff)
downloadqtlocation-mapboxgl-b3ffeceb9e0077fc81330a411a2ae1b590ec8dd6.tar.gz
[core] check null data in query source features
-rw-r--r--src/mbgl/tile/geometry_tile.cpp5
-rw-r--r--test/tile/vector_tile.test.cpp9
2 files changed, 14 insertions, 0 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index 5f1fc5de66..5ccc037ce0 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -165,6 +165,11 @@ void GeometryTile::queryRenderedFeatures(
void GeometryTile::querySourceFeatures(
std::vector<Feature>& result,
const style::SourceQueryOptions& options) {
+
+ // Data not yet available
+ if (!data) {
+ return;
+ }
// No source layers, specified, nothing to do
if (!options.sourceLayers) {
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp
index 859fd417b0..aa39824787 100644
--- a/test/tile/vector_tile.test.cpp
+++ b/test/tile/vector_tile.test.cpp
@@ -86,3 +86,12 @@ TEST(VectorTile, Issue7615) {
EXPECT_EQ(symbolBucket.get(), tile.getBucket(symbolLayer));
}
+
+TEST(VectorTile, Issue8542) {
+ VectorTileTest test;
+ VectorTile tile(OverscaledTileID(0, 0, 0), "source", test.updateParameters, test.tileset);
+
+ // Query before data is set
+ std::vector<Feature> result;
+ tile.querySourceFeatures(result, { { {"layer"} }, {} });
+} \ No newline at end of file