From 8b3b5b3ce7e421074ee71de007f89a87a1c01697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Fri, 24 Jan 2025 11:59:26 +0100 Subject: [PATCH] Fix undefined error when checkpoints is empty (#7567) --- packages/notebook-extension/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index b43e622e19..cd9d9752d1 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -124,7 +124,7 @@ const checkpoints: JupyterFrontEndPlugin = { context?.fileChanged.connect(onChange); const checkpoints = await context?.listCheckpoints(); - if (!checkpoints) { + if (!checkpoints || !checkpoints.length) { return; } const checkpoint = checkpoints[checkpoints.length - 1];