Skip to content

Commit d89671c

Browse files
committed
fix: add null-check to avoid runtime exceptions under some circumstances on returned values
1 parent b79119e commit d89671c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/interpreter/policy/is-trap-condition-met.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function handleTrapCondition<T extends object, ConditionType>(
5858
// If matching the condition depends on the provided arguments, pass them in
5959
if (isTrapConditionFunction(trapCondition)) {
6060
const castItem = item as IPolicyProxyApplyHookOptions<T> | IPolicyProxyConstructHookOptions<T>;
61-
return trapCondition(...castItem.argArray) === matchCondition;
61+
return castItem.argArray != null && trapCondition(...castItem.argArray) === matchCondition;
6262
}
6363

6464
// Otherwise, evaluate the truthiness of the condition

0 commit comments

Comments
 (0)