playground_links_popover: Return if 'playground_info' is undefined.

We need fields like 'url_template' to do the code extraction.
Those are absent if 'playground_info' is undefined, thus we should
return immediately in those cases.
This commit is contained in:
Varun Singh
2024-02-13 23:28:29 +05:30
committed by Tim Abbott
parent 3fa308369d
commit e246db6709

View File

@@ -101,6 +101,9 @@ function register_click_handlers(): void {
const playground_info = realm_playground.get_playground_info_for_languages(
$codehilite_div.data("code-language"),
);
if (playground_info === undefined) {
return;
}
// We do the code extraction here and set the target href expanding
// the url_template with the extracted code. Depending on whether
// the language has multiple playground links configured, a popover