fix silent publickey error
This commit is contained in:
parent
76785dfeca
commit
6a46912221
|
@ -30,6 +30,7 @@ import { notify } from 'utils/notifications'
|
|||
import { usePlausible } from 'next-plausible'
|
||||
import { TelemetryEvents } from 'utils/telemetry'
|
||||
import { groupBy, mapValues, maxBy, sampleSize } from 'lodash'
|
||||
import { tryGetPubKey } from 'utils/governance/tools'
|
||||
|
||||
const set = mangoStore.getState().set
|
||||
const actions = mangoStore.getState().actions
|
||||
|
@ -228,7 +229,7 @@ const ReadOnlyMangoAccount = () => {
|
|||
|
||||
async function loadUnownedMangoAccount() {
|
||||
try {
|
||||
if (!ma || !group) return
|
||||
if (!ma || !group || !tryGetPubKey(ma)) return
|
||||
|
||||
const client = mangoStore.getState().client
|
||||
const pk = new PublicKey(ma)
|
||||
|
|
|
@ -92,7 +92,7 @@ export function parseMintAccountData(data: Buffer): RawMint {
|
|||
export const fmtTokenAmount = (c: BN, decimals?: number) =>
|
||||
c?.div(new BN(10).pow(new BN(decimals ?? 0))).toNumber() || 0
|
||||
|
||||
export const tryGetPubKey = (pubkey: string) => {
|
||||
export const tryGetPubKey = (pubkey: string | string[]) => {
|
||||
try {
|
||||
return new PublicKey(pubkey)
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in New Issue