mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #19192 from overleaf/em-project-history-avoid-crash
Prevent project-history crashes when generating a diff GitOrigin-RevId: 513fb846f0884a68d4550783497ae436e1cba00f
This commit is contained in:
@@ -37,7 +37,18 @@ export function getDiff(projectId, pathname, fromVersion, toVersion, callback) {
|
||||
if (binary) {
|
||||
diff = { binary: true }
|
||||
} else {
|
||||
diff = DiffGenerator.buildDiff(initialContent, updates)
|
||||
try {
|
||||
diff = DiffGenerator.buildDiff(initialContent, updates)
|
||||
} catch (err) {
|
||||
return callback(
|
||||
OError.tag(err, 'failed to build diff', {
|
||||
projectId,
|
||||
pathname,
|
||||
fromVersion,
|
||||
toVersion,
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
callback(null, diff)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user