Skip to content

Commit 3ead245

Browse files
committed
Return null instead of throwing error
1 parent 994300d commit 3ead245

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

solana/ts/lib/ntt.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export namespace NTT {
320320
};
321321
const pubkeys = collectPubkeys(entries).map((pk) => pk.toBase58());
322322

323-
let existingLut: web3.AddressLookupTableAccount | null =
323+
const existingLut: web3.AddressLookupTableAccount | null =
324324
await getAddressLookupTable(program, pdas);
325325

326326
if (existingLut !== null) {
@@ -1002,10 +1002,7 @@ export namespace NTT {
10021002

10031003
pdas = pdas ?? NTT.pdas(program.programId);
10041004
const lut = await program.account.lut.fetchNullable(pdas.lutAccount());
1005-
if (!lut)
1006-
throw new Error(
1007-
"Address lookup table not found. Did you forget to call initializeLUT?"
1008-
);
1005+
if (!lut) return null;
10091006

10101007
const response = await program.provider.connection.getAddressLookupTable(
10111008
lut.address

0 commit comments

Comments
 (0)