Ensure safety check on isEmpty (#11358)

This commit is contained in:
Tarik Gul 2025-03-04 07:51:18 -08:00 committed by GitHub
parent e6ce6b3a6d
commit fc2b1c3657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}
}