Skip to content

Commit

Permalink
Fix undefined error when checkpoints is empty (#7567)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid authored Jan 24, 2025
1 parent 1f0ab83 commit 8b3b5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const checkpoints: JupyterFrontEndPlugin<void> = {
context?.fileChanged.connect(onChange);

const checkpoints = await context?.listCheckpoints();
if (!checkpoints) {
if (!checkpoints || !checkpoints.length) {
return;
}
const checkpoint = checkpoints[checkpoints.length - 1];
Expand Down

0 comments on commit 8b3b5b3

Please sign in to comment.