diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-10-25 12:08:28 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-10-25 12:08:28 -0700 |
commit | 6f51186dc1dfb52f5add46cb24825873d173ecef (patch) | |
tree | fd6a70e01f4cd9ecd840d7e37ec8af3affa67f04 | |
parent | 8038ad391da8d2fcb3fecd2bc8b797835a7e84ac (diff) |
Fix default to Null for feature-state expressions.
-rw-r--r-- | src/mbgl/style/expression/compound_expression.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp index 3e01ad593..f810ddbe9 100644 --- a/src/mbgl/style/expression/compound_expression.cpp +++ b/src/mbgl/style/expression/compound_expression.cpp @@ -410,12 +410,13 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali }); define("feature-state", [](const EvaluationContext& params, const std::string& key) -> Result<Value> { - if (!params.feature || !params.featureState) { + if (!params.feature) { return EvaluationError { "Feature state data is unavailable in the current evaluation context." }; } + if (!params.featureState) { return Null; } auto statePair = params.featureState->find(key); if (statePair == params.featureState->end()) { return Null; |