Skip to content

Commit

Permalink
Ensure safety check on isEmpty (#11358)
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul authored Mar 4, 2025
1 parent e6ce6b3 commit fc2b1c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-hooks/src/utils/isEmpty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import type { Struct } from '@polkadot/types-codec';

export const isEmpty = (struct: Struct) => {
for (const v of struct.values()) {
if (!v.isEmpty) {
return false;
if (struct.values) {
for (const v of struct.values()) {
if (!v.isEmpty) {
return false;
}
}
}

Expand Down

0 comments on commit fc2b1c3

Please sign in to comment.