mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-25 07:47:27 +00:00
fix: prevent split on undefined(#491) (#563)
This commit is contained in:
@@ -33,7 +33,12 @@ export const ToolDiffViewer: React.FC<ToolDiffViewerProps> = ({
|
||||
: 'bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400';
|
||||
|
||||
const diffLines = useMemo(
|
||||
() => createDiff(oldContent, newContent),
|
||||
() => {
|
||||
if (oldContent === undefined || newContent === undefined) {
|
||||
return [];
|
||||
}
|
||||
return createDiff(oldContent, newContent)
|
||||
},
|
||||
[createDiff, oldContent, newContent]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user