verze-app / solana-php-sdk

Simple PHP SDK for Solana JSON RPC endpoints
MIT License
88 stars 45 forks source link

getAccountInfo() does not properly handle a missing account. #5

Closed exzachlyvv closed 2 years ago

exzachlyvv commented 2 years ago

Right now, if you call the getAccountInfo({pubKey}) method where the {pubKey} does not exist, it will fail with error message:

TypeError: Tighten\SolanaPhpSdk\Solana::getAccountInfo(): Return value must be of type array, null returned

I propose that we check for this, and throw a new AccountNotFoundException.