From 38b5fc32f7a19e45d8bc7a38873556e4b18d73e8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 30 May 2024 10:07:59 -0700 Subject: [PATCH] playground_links_popover: Fix TypeScript noUncheckedIndexedAccess errors. Signed-off-by: Anders Kaseorg --- web/src/playground_links_popover.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/playground_links_popover.ts b/web/src/playground_links_popover.ts index bfc4c7bfd5..b2b7a20aef 100644 --- a/web/src/playground_links_popover.ts +++ b/web/src/playground_links_popover.ts @@ -111,7 +111,7 @@ function register_click_handlers(): void { // the language has multiple playground links configured, a popover // is shown. const extracted_code = $codehilite_div.find("code").text(); - if (playground_info.length === 1) { + if (playground_info.length === 1 && playground_info[0] !== undefined) { const url_template = url_template_lib.parse(playground_info[0].url_template); $view_in_playground_button.attr( "href",