check for property via selector before using value(forKey:)

This commit is contained in:
Ilya Puchka
2018-09-11 18:12:27 +01:00
parent d71fe2a2ee
commit 0074ee1d4a
3 changed files with 12 additions and 2 deletions

View File

@@ -148,6 +148,12 @@ func testVariable() {
let result = try variable.resolve(context) as? String
try expect(result) == "Foo"
}
$0.it("does not crash on KVO") {
let variable = Variable("object.fullname")
let result = try variable.resolve(context) as? String
try expect(result).to.beNil()
}
#endif
$0.it("can resolve a value via reflection") {