fix(Util): reject with a meaningful error instead of throwing one

This commit is contained in:
SpaceEEC
2018-04-27 20:16:46 +02:00
parent b05622766b
commit 44fefdfa49
2 changed files with 2 additions and 2 deletions

View File

@@ -271,7 +271,7 @@ class ClientDataResolver {
});
}
});
} else if (resource.pipe && typeof resource.pipe === 'function') {
} else if (resource && resource.pipe && typeof resource.pipe === 'function') {
return new Promise((resolve, reject) => {
const buffers = [];
resource.once('error', reject);