Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/arg-parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export function parseSpanDepth(input: string): number {
return 0;
}
const n = Number(input);
if (Number.isNaN(n)) {
if (Number.isNaN(n) || n < 0) {
return DEFAULT_SPAN_DEPTH;
}
return n;
Expand Down
10 changes: 9 additions & 1 deletion src/lib/db/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ export function getPaginationState(
return;
}

const stack = JSON.parse(row.cursor_stack) as string[];
let stack: string[];
try {
stack = JSON.parse(row.cursor_stack) as string[];
} catch {
db.query(
"DELETE FROM pagination_cursors WHERE command_key = ? AND context = ?"
).run(commandKey, contextKey);
return;
}
return { stack, index: row.page_index };
}

Expand Down
Loading