Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 21, 2023
1 parent d16fee2 commit 0f65ddc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/projector/otto/mac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,18 @@ export class ProjectorOttoMac extends ProjectorOtto {
let data: Uint8Array | null = null;
for (const patch of patches) {
if (patch.match(entry.volumePath)) {
// eslint-disable-next-line no-await-in-loop
data = data || (await entry.read());
if (!data) {
throw new Error(
`Failed to read: ${entry.volumePath}`
// eslint-disable-next-line no-await-in-loop
const d = await entry.read();
if (!d) {
throw new Error(
`Failed to read: ${entry.volumePath}`
);
}
data = new Uint8Array(
d.buffer,
d.byteOffset,
d.byteLength
);
}
// eslint-disable-next-line no-await-in-loop
Expand Down

0 comments on commit 0f65ddc

Please sign in to comment.