Skip to content

Commit

Permalink
guard let
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrico972 committed Apr 8, 2024
1 parent bfe9572 commit 8865254
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/AirshipReactNative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,12 @@ public extension AirshipReactNative {
@objc
public extension AirshipReactNative {
func actionsRun(action: [String: Any?]) async throws-> Any? {
guard let name = action["name"] as? String else {
throw AirshipErrors.error("missing name")
}

return try await AirshipProxy.shared.action.runAction(
action["name"] as! String,
name,
value: action["value"] is NSNull ? nil : try AirshipJSON.wrap(action["value"])
)
}
Expand Down

0 comments on commit 8865254

Please sign in to comment.