Update Options.swift

checking if object is null before checking if nil. causes to crash if null.
This commit is contained in:
cloudygeek 2021-06-18 09:27:27 +01:00 committed by GitHub
parent f06bcdf695
commit 3c60c15a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ 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)) {
if !(value is NSNull), value != nil, self.responds(to: Selector(key)) {
self.setValue(value, forKey: key)
}
}