Fixed crash when trying to diff binary files
This commit is contained in:
parent
7c0316b2d3
commit
1d2ad6f947
1 changed files with 8 additions and 3 deletions
|
@ -41,9 +41,14 @@ class DiffViewModel @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
val hunks = diffManager.diffFormat(git, diffEntryType)
|
||||
|
||||
_diffResult.value = DiffResult(diffEntryType, hunks)
|
||||
//TODO: Just a workaround when trying to diff binary files
|
||||
try {
|
||||
val hunks = diffManager.diffFormat(git, diffEntryType)
|
||||
_diffResult.value = DiffResult(diffEntryType, hunks)
|
||||
} catch (ex: Exception) {
|
||||
ex.printStackTrace()
|
||||
_diffResult.value = DiffResult(diffEntryType, emptyList())
|
||||
}
|
||||
|
||||
return@runOperation RefreshType.NONE
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue