Skip to content

Commit 8f125c6

Browse files
Megashubhamgemini-code-assist[bot]
authored andcommitted
Update packages/core/src/tools/edit.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 91bd882 commit 8f125c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/core/src/tools/edit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ class EditToolInvocation
838838
}
839839

840840
const getSnippet = (str: string): string => {
841-
const normalized = str.replace(/\r\n/g, '\n');
841+
const normalized = (str ?? '').replace(/\r\n/g, '\n');
842842
const newlineIdx = normalized.indexOf('\n');
843843
const firstLine =
844844
newlineIdx !== -1 ? normalized.substring(0, newlineIdx) : normalized;

0 commit comments

Comments
 (0)