Skip to content

Commit

Permalink
Only save snapshot if bundle exists
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinBrett committed Jan 13, 2025
1 parent c6c2edc commit 5552930
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/apps/JSDOS/useDosCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ const useDosCI = (
const { createSnapshot } = useSnapshots();
const closeBundle = useCallback(
async (bundleUrl: string, screenshot?: Buffer, closeInstance = false) => {
await createSnapshot(
`${basename(bundleUrl)}${saveExtension}`,
Buffer.from((await dosCI[bundleUrl].persist()) || []),
screenshot
);
if (dosCI[bundleUrl]) {
await createSnapshot(
`${basename(bundleUrl)}${saveExtension}`,
Buffer.from((await dosCI[bundleUrl].persist()) || []),
screenshot
);
}

if (closeInstance) {
try {
Expand Down

0 comments on commit 5552930

Please sign in to comment.