From 19ffe781e68dcc9fdd339bf0508642407a47ce11 Mon Sep 17 00:00:00 2001 From: Caleb Jones Date: Mon, 3 May 2021 10:31:54 -0400 Subject: [PATCH 1/2] Fix parsing crash on null value. --- ios/Classes/Options.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ios/Classes/Options.swift b/ios/Classes/Options.swift index 286a2f83..96ba50eb 100755 --- a/ios/Classes/Options.swift +++ b/ios/Classes/Options.swift @@ -16,8 +16,10 @@ public class Options: 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 From 099223a24e8ba15248376b4eba6613b2f455f3f2 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Fri, 15 Apr 2022 20:16:10 +0200 Subject: [PATCH 2/2] Update Options.swift --- ios/Classes/Options.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/Options.swift b/ios/Classes/Options.swift index 96ba50eb..08f4976e 100755 --- a/ios/Classes/Options.swift +++ b/ios/Classes/Options.swift @@ -16,7 +16,7 @@ public class Options: NSObject { func parse(options: [String: Any?]) -> Options { for (key, value) in options { - if !(value is NSNull) { + if value != nil, !(value is NSNull) { if self.responds(to: Selector(key)) { self.setValue(value, forKey: key) }