Skip to content

program.accounts.[account].fetchNullable throws an error instead of returning null when there's no account #18

@ch0c0l8ra1n

Description

@ch0c0l8ra1n
const randomKeyPair = anchor.web3.Keypair.generate();
const account = await program.account.treasury.fetchNullable(randomKeyPair.publicKey);

This will throw an error instead of just returning null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions