Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit b708e3e

Browse files
committed
fix: get empty field
1 parent ddf5122 commit b708e3e

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/lib/transaction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default class Transaction extends BaseObject implements TransactionInterf
4545
jwk: JWKInterface | 'use_wallet' = 'use_wallet',
4646
) {
4747
super();
48+
4849
Object.assign(this, attributes);
4950

5051
// If something passes in a Tx that has been toJSON'ed and back,

src/utils/baseObject.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ export class BaseObject implements BaseObjectInterface {
1212

1313
// Handle fields that are Uint8Array.
1414
// To maintain compatibility, we encode them to b64url, only if the decode option is not specified.
15-
if (typeof this[field] === null) {
16-
throw new Error(`Field "${field}" not set.`);
17-
}
18-
19-
if (this[field].constructor.name === 'Uint8Array') {
15+
if (this[field] && this[field].constructor.name === 'Uint8Array') {
2016
if (options && options.decode && options.string) {
2117
return bufferToString(this[field]);
2218
}

0 commit comments

Comments
 (0)