This commit is contained in:
Tomas Della Vedova
2021-10-29 14:48:40 +02:00
committed by GitHub
parent d0a421b25c
commit 249d2a6398
2 changed files with 137 additions and 4 deletions

View File

@ -171,10 +171,14 @@ class Transport {
let request = { abort: noop }
const transportReturn = {
then (onFulfilled, onRejected) {
return p.then(onFulfilled, onRejected)
if (p != null) {
return p.then(onFulfilled, onRejected)
}
},
catch (onRejected) {
return p.catch(onRejected)
if (p != null) {
return p.catch(onRejected)
}
},
abort () {
meta.aborted = true
@ -183,7 +187,9 @@ class Transport {
return this
},
finally (onFinally) {
return p.finally(onFinally)
if (p != null) {
return p.finally(onFinally)
}
}
}