fix: handle empty map cases properly
This commit is contained in:
parent
87d35f1751
commit
de5450376b
1 changed files with 4 additions and 3 deletions
|
|
@ -63,11 +63,12 @@ export class DocumentHistoryTracker {
|
|||
if (!astHistory || !documentHistory) {
|
||||
console.error(`Document ${documentPath} not found in AST tracker`);
|
||||
this.addDocument(documentPath, documentContent, ast);
|
||||
return; // Early return - document was added with initial state
|
||||
}
|
||||
|
||||
// Push to top (LIFO).
|
||||
astHistory!.unshift(ast);
|
||||
documentHistory!.unshift(documentContent);
|
||||
// Only execute this if the arrays already existed
|
||||
astHistory.unshift(ast);
|
||||
documentHistory.unshift(documentContent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue