Skip to content

Commit 8865254

Browse files
committed
guard let
1 parent bfe9572 commit 8865254

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ios/AirshipReactNative.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ public extension AirshipReactNative {
329329
@objc
330330
public extension AirshipReactNative {
331331
func actionsRun(action: [String: Any?]) async throws-> Any? {
332+
guard let name = action["name"] as? String else {
333+
throw AirshipErrors.error("missing name")
334+
}
335+
332336
return try await AirshipProxy.shared.action.runAction(
333-
action["name"] as! String,
337+
name,
334338
value: action["value"] is NSNull ? nil : try AirshipJSON.wrap(action["value"])
335339
)
336340
}

0 commit comments

Comments
 (0)