Fixed crash when trying to diff binary files

This commit is contained in:
Abdelilah El Aissaoui 2022-01-05 03:02:36 +01:00
parent 7c0316b2d3
commit 1d2ad6f947

View file

@ -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
}