From 031b00b108e8a6b54718ceb0af4a1edebf208773 Mon Sep 17 00:00:00 2001 From: Harry Solovay Date: Thu, 13 Jul 2023 10:00:37 -0400 Subject: [PATCH] fix: return empty list when no entries (#1170) --- fluent/StorageRune.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fluent/StorageRune.ts b/fluent/StorageRune.ts index d6d8c1935..c372f222e 100644 --- a/fluent/StorageRune.ts +++ b/fluent/StorageRune.ts @@ -84,12 +84,13 @@ export class StorageRune< return Rune .tuple([this.entriesRaw(props, blockHash).access(0), this.$key, this.$value]) .map(([changeset, $key, $value]) => - changeset!.changes.map(([k, v]) => [ + changeset?.changes.map(([k, v]) => [ $key.decode(hex.decode(k)), v ? $value.decode(hex.decode(v)) : undefined, - ]) + ]) ?? [] ) .unsafeAs<[Chain.Storage.Key, Chain.Storage.Value][]>() + .into(ValueRune) } keysRaw(