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 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/mbgl/style/conversion/data_driven_property_value.hpp b/include/mbgl/style/conversion/data_driven_property_value.hpp index 59d197b216..2d8817ecf4 100644 --- a/include/mbgl/style/conversion/data_driven_property_value.hpp +++ b/include/mbgl/style/conversion/data_driven_property_value.hpp @@ -29,8 +29,8 @@ struct Converter<DataDrivenPropertyValue<T>> { ParsingContext ctx(valueTypeToExpressionType<T>()); ParseResult parsed = ctx.parseLayerPropertyExpression(value); if (!parsed) { - error = { ctx.getCombinedErrors() }; - return {}; + error.message = ctx.getCombinedErrors(); + return nullopt; } expression = PropertyExpression<T>(std::move(*parsed)); } else if (isObject(value)) { @@ -38,26 +38,26 @@ struct Converter<DataDrivenPropertyValue<T>> { } else { optional<T> constant = convert<T>(value, error); if (!constant) { - return {}; + return nullopt; } return convertTokens ? maybeConvertTokens(*constant) : DataDrivenPropertyValue<T>(*constant); } if (!expression) { - return {}; + return nullopt; } else if (!(*expression).isFeatureConstant() || !(*expression).isZoomConstant()) { return { std::move(*expression) }; } else if ((*expression).getExpression().getKind() == Kind::Literal) { optional<T> constant = fromExpressionValue<T>( static_cast<const Literal&>((*expression).getExpression()).getValue()); if (!constant) { - return {}; + return nullopt; } return DataDrivenPropertyValue<T>(*constant); } else { assert(false); - error = { "expected a literal expression" }; - return {}; + error.message = "expected a literal expression"; + return nullopt; } } |