You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guardlet value = expectedValues.removeValue(forKey: keyPath)as?Valueelse{
213
-
fatalError("Attempted to read value \(keyPath asAnyKeyPath), when applying an action, but no value was present. Pass an instance of the Workflow to the ActionTester to enable this functionality.")
212
+
guard
213
+
// We have an expected value
214
+
let value = expectedValues.removeValue(forKey: keyPath),
215
+
// And it's the right type
216
+
let value = value as?Value
217
+
else{
218
+
// We're expecting a value of optional type. Error, but don't crash
219
+
// since we can just return nil.
220
+
ifValue.self is OptionalProtocol.Type{
221
+
reportIssue("Attempted to read value \(keyPath asAnyKeyPath), when applying an action, but no value was present. Pass an instance of the Workflow to the ActionTester to enable this functionality.")
222
+
returnAny?.none as!Value
223
+
}else{
224
+
fatalError("Attempted to read value \(keyPath asAnyKeyPath), when applying an action, but no value was present. Pass an instance of the Workflow to the ActionTester to enable this functionality.")
0 commit comments