Skip to content

Commit d3b2a57

Browse files
committed
Fixed ql warning Expression can be replaced with a cast
1 parent 2e2b9a9 commit d3b2a57

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

javascript/ql/src/Quality/UnhandledStreamPipe.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,7 @@ private DataFlow::SourceNode sourceStreamRef(PipeCall pipeCall) {
218218
* Holds if the source stream of the given pipe call has an `error` handler registered.
219219
*/
220220
private predicate hasErrorHandlerRegistered(PipeCall pipeCall) {
221-
exists(ErrorHandlerRegistration handler |
222-
handler = sourceStreamRef(pipeCall).getAMethodCall(getEventHandlerMethodName())
223-
)
221+
sourceStreamRef(pipeCall).getAMethodCall(_) instanceof ErrorHandlerRegistration
224222
or
225223
hasPlumber(pipeCall)
226224
}

0 commit comments

Comments
 (0)