Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix: Fix undefined positions when cache is not primed (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
immasandwich authored Apr 29, 2022
1 parent 8003105 commit 7f82b34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/position/position-source/position-source.registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export class RegistryPositionSource implements PositionSource {
);

const validFetchers = compact(fetchers);
const positions = (await Promise.all(validFetchers.map(fetcher => fetcher.getPositions()))) as T[][];
const positions = (await Promise.all(
validFetchers.map(async fetcher => (await fetcher.getPositions()) ?? []),
)) as T[][];
return positions.flat();
}
}

0 comments on commit 7f82b34

Please sign in to comment.