better check for undefined

This commit is contained in:
Pavel Murygin 2022-07-05 23:19:53 +03:00
parent cbe7daadca
commit 824f9a89fe

View File

@ -34,7 +34,7 @@ export async function main(environment: Node[]) {
console.log('📘 uploading .wasm to node %s', providerHost.multiaddr); console.log('📘 uploading .wasm to node %s', providerHost.multiaddr);
const firstThing = await globSource('../service/artifacts/', 'process_files.wasm').next(); const firstThing = await globSource('../service/artifacts/', 'process_files.wasm').next();
const fileCandidate = await firstThing.value const fileCandidate = await firstThing.value
if(typeof fileCandidate === 'undefined') { if(fileCandidate === undefined) {
throw new Error("Couldn't read process_files.wasm"); throw new Error("Couldn't read process_files.wasm");
} }
let { file, swarmAddr, rpcAddr } = await provideFile(fileCandidate, providerClient); let { file, swarmAddr, rpcAddr } = await provideFile(fileCandidate, providerClient);