Ensure safety check on isEmpty (#11358)
This commit is contained in:
parent
e6ce6b3a6d
commit
fc2b1c3657
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user