Skip to content

Commit aef251f

Browse files
NaccOlldaniel-lxs
authored andcommitted
fix: add validation for checkpointDiff mode to ensure first checkpoint exists
1 parent b7f40c2 commit aef251f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/checkpoints/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ export async function checkpointDiff(task: Task, { ts, previousCommitHash, commi
297297

298298
const checkpoints = task.clineMessages.filter(({ say }) => say === "checkpoint_saved").map(({ text }) => text!)
299299

300+
if (["from-init", "full"].includes(mode) && checkpoints.length < 1) {
301+
vscode.window.showInformationMessage("No first checkpoint to compare.")
302+
return
303+
}
304+
300305
const idx = checkpoints.indexOf(commitHash)
301306
switch (mode) {
302307
case "checkpoint":

0 commit comments

Comments
 (0)