Fix undefined error when checkpoints is empty (#7567)

J. David Ibáñez 1 year ago committed by GitHub
parent 1f0ab8365b
commit 8b3b5b3ce7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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];

Loading…
Cancel
Save