Skip to content

Commit c6f5319

Browse files
committed
ignore when the reciever is the empty array
1 parent da23898 commit c6f5319

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/src/Statements/IgnoreArrayResult.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ predicate isIgnoredPureArrayCall(DataFlow::MethodCallNode call) {
4141
}
4242

4343
from DataFlow::MethodCallNode call
44-
where callsArray(call) instanceof DataFlow::ArrayCreationNode
44+
where
45+
callsArray(call) instanceof DataFlow::ArrayCreationNode and
46+
not call.getReceiver().asExpr().(ArrayExpr).getSize() = 0
4547
select call, "Result from call to " + call.getMethodName() + " ignored."

0 commit comments

Comments
 (0)