fix(tracing): check if source exists before adding to zip (#10986)

This commit is contained in:
Yury Semikhatsky 2021-12-17 11:52:28 -08:00 committed by GitHub
parent 0d277fa589
commit eb9c8a8f06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,10 +223,12 @@ export class Tracing implements InstrumentationListener, SnapshotterDelegate, Ha
sourceEntries = []; sourceEntries = [];
for (const value of state.sources) { for (const value of state.sources) {
const entry = { name: 'resources/src@' + calculateSha1(value) + '.txt', value }; const entry = { name: 'resources/src@' + calculateSha1(value) + '.txt', value };
if (params.mode === 'compressTraceAndSources') if (params.mode === 'compressTraceAndSources') {
entries.push(entry); if (fs.existsSync(entry.value))
else entries.push(entry);
} else {
sourceEntries.push(entry); sourceEntries.push(entry);
}
} }
} }