diff options
Diffstat (limited to 'include/mbgl/style/conversion/data_driven_property_value.hpp')
-rw-r--r-- | include/mbgl/style/conversion/data_driven_property_value.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/mbgl/style/conversion/data_driven_property_value.hpp b/include/mbgl/style/conversion/data_driven_property_value.hpp index f1bd1bdbb7..59d197b216 100644 --- a/include/mbgl/style/conversion/data_driven_property_value.hpp +++ b/include/mbgl/style/conversion/data_driven_property_value.hpp @@ -47,13 +47,17 @@ struct Converter<DataDrivenPropertyValue<T>> { return {}; } else if (!(*expression).isFeatureConstant() || !(*expression).isZoomConstant()) { return { std::move(*expression) }; - } else { + } else if ((*expression).getExpression().getKind() == Kind::Literal) { optional<T> constant = fromExpressionValue<T>( - dynamic_cast<const Literal&>((*expression).getExpression()).getValue()); + static_cast<const Literal&>((*expression).getExpression()).getValue()); if (!constant) { return {}; } return DataDrivenPropertyValue<T>(*constant); + } else { + assert(false); + error = { "expected a literal expression" }; + return {}; } } |