From 4bc994cff7afddafd3668c2ccecf8e4e64bf5441 Mon Sep 17 00:00:00 2001 From: Noah Gundotra Date: Wed, 10 Jul 2024 22:03:44 -0400 Subject: [PATCH] Handle when IDL name missing (#352) --- app/utils/anchor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/anchor.tsx b/app/utils/anchor.tsx index 5d3e54f2..adc55ab6 100644 --- a/app/utils/anchor.tsx +++ b/app/utils/anchor.tsx @@ -11,7 +11,7 @@ import { ChevronDown, ChevronUp, CornerDownRight } from 'react-feather'; import ReactJson from 'react-json-view'; export function getAnchorProgramName(program: Program | null): string | undefined { - return program ? snakeToTitleCase(program.idl.name) : undefined; + return program && 'name' in program.idl ? snakeToTitleCase(program.idl.name) : undefined; } export function AnchorProgramName({