fix(default): Check for wrapped nil in filter (#162)

This commit is contained in:
Ilya Puchka
2017-12-24 20:11:46 +01:00
committed by Kyle Fuller
parent 9357df35d1
commit 1223efbc7e
3 changed files with 11 additions and 1 deletions

View File

@@ -11,7 +11,8 @@ func lowercase(_ value: Any?) -> Any? {
}
func defaultFilter(value: Any?, arguments: [Any?]) -> Any? {
if let value = value {
// value can be optional wrapping nil, so this way we check for underlying value
if let value = value, String(describing: value) != "nil" {
return value
}