ts: Fix undefined iterable (#571)

This commit is contained in:
Armani Ferrante 2021-08-03 16:13:31 -07:00 committed by GitHub
parent ad075ceb56
commit 21cc98517a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ export class InstructionCoder {
let fieldLayouts = m.args.map((arg: IdlField) => {
return IdlCoder.fieldLayout(
arg,
Array.from([...idl.accounts, ...idl.types])
Array.from([...idl.accounts, ...(idl.types ?? [])])
);
});
const name = camelCase(m.name);
@ -101,7 +101,7 @@ export class InstructionCoder {
let fieldLayouts = ix.args.map((arg: IdlField) =>
IdlCoder.fieldLayout(
arg,
Array.from([...idl.accounts, ...idl.types])
Array.from([...idl.accounts, ...(idl.types ?? [])])
)
);
const name = camelCase(ix.name);