Skip to content

Commit c0a32ca

Browse files
authored
Fix build errors (#450)
After #448, there were some build errors, at least in CI. This adds some validation to make sure `snaps` is defined before trying to process it.
1 parent dcdd6d3 commit c0a32ca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/features/snaps/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export const snapsApi = createApi({
3737
method: 'wallet_getAllSnaps',
3838
}),
3939
transformResponse(snaps: GetAllSnapsResult) {
40+
if (!snaps) {
41+
return {};
42+
}
43+
4044
return snaps.reduce<Record<string, GetAllSnapsResult[0]>>(
4145
(accumulator, snap) => {
4246
accumulator[snap.id] = snap;

0 commit comments

Comments
 (0)