diff --git a/javascript/ql/src/Expressions/MissingAwait.ql b/javascript/ql/src/Expressions/MissingAwait.ql index 08b6c7af0bb..cb59b3ec738 100644 --- a/javascript/ql/src/Expressions/MissingAwait.ql +++ b/javascript/ql/src/Expressions/MissingAwait.ql @@ -9,6 +9,7 @@ */ import javascript +private import semmle.javascript.internal.TypeResolution /** * Holds if `call` is a call to an `async` function. @@ -27,7 +28,7 @@ predicate isPromise(DataFlow::SourceNode node, boolean nullable) { isAsyncCall(node, nullable) or not isAsyncCall(node, _) and - node.asExpr().getType() instanceof PromiseType and + TypeResolution::valueHasPromiseType(node.asExpr()) and nullable = true }