[android] - provide correct expression integration for newly created property values

This commit is contained in:
Tobrun
2018-08-29 18:28:51 +02:00
committed by Tobrun
parent 3f021970ea
commit e4bcd1abed
2 changed files with 18 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ public class PropertyValue<T> {
* @return true if this is a expression, false if not
*/
public boolean isExpression() {
return !isNull() && value instanceof JsonArray;
return !isNull() && (value instanceof JsonArray || value instanceof Expression);
}
/**
@@ -57,7 +57,9 @@ public class PropertyValue<T> {
@Nullable
public Expression getExpression() {
if (isExpression()) {
return Expression.Converter.convert((JsonArray) value);
return value instanceof JsonArray
? Expression.Converter.convert((JsonArray) value)
: (Expression) value;
} else {
Logger.w(TAG, "not a expression, try value");
return null;