Merge pull request #828 from ItsCalebJones/bugfix/parsing_error
Fix parsing crash on null value.
This commit is contained in:
commit
d1aa8b0281
|
@ -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 != nil, !(value is NSNull) {
|
||||
if self.responds(to: Selector(key)) {
|
||||
self.setValue(value, forKey: key)
|
||||
}
|
||||
}
|
||||
}
|
||||
return self
|
||||
|
|
Loading…
Reference in New Issue