diff options
Diffstat (limited to 'include/mbgl/style/conversion/property_value.hpp')
-rw-r--r-- | include/mbgl/style/conversion/property_value.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/mbgl/style/conversion/property_value.hpp b/include/mbgl/style/conversion/property_value.hpp index db23074c5e..b03655a848 100644 --- a/include/mbgl/style/conversion/property_value.hpp +++ b/include/mbgl/style/conversion/property_value.hpp @@ -54,13 +54,17 @@ struct Converter<PropertyValue<T>> { return {}; } else if (!(*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 PropertyValue<T>(*constant); + } else { + assert(false); + error = { "expected a literal expression" }; + return {}; } } }; |