Fix parsing crash on null value.

This commit is contained in:
Caleb Jones 2021-05-03 10:31:54 -04:00
parent f06bcdf695
commit 19ffe781e6
1 changed files with 4 additions and 2 deletions

View File

@ -16,8 +16,10 @@ public class Options<T>: NSObject {
func parse(options: [String: Any?]) -> Options {
for (key, value) in options {
if value != nil, !(value is NSNull), self.responds(to: Selector(key)) {
self.setValue(value, forKey: key)
if !(value is NSNull) {
if self.responds(to: Selector(key)) {
self.setValue(value, forKey: key)
}
}
}
return self