Skip to content

Commit 0a94eed

Browse files
committed
bugfix: recent sage kernel workaround can cause crash
1 parent 35ae9d1 commit 0a94eed

File tree

1 file changed

+2
-1
lines changed
  • src/packages/frontend/jupyter/output-messages/mime-types

1 file changed

+2
-1
lines changed

src/packages/frontend/jupyter/output-messages/mime-types/data.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ function getUntrustedType(kernelspec: KernelSpec | undefined, types: string[]) {
7777
}
7878

7979
function getTypeToRender(kernelspec, types: string[]): string {
80-
if (kernelspec.language?.startsWith("sage")) {
80+
if (kernelspec?.language?.startsWith("sage")) {
81+
// kernelspec might not be defined initially.
8182
// special case because sage's text/html is horrible.
8283
if (
8384
(types.includes("text/html") || types.includes("iframe")) &&

0 commit comments

Comments
 (0)