git merge: don't fail if file content can't be retrieved

The merge button should be disabled in this case,
but let's avoid the exception as it is done for other revisions.
This commit is contained in:
Kirill Likhodedov
2017-02-26 15:15:56 +00:00
parent 788cddb3b1
commit 116f83e679
@@ -134,7 +134,13 @@ public class GitMergeProvider implements MergeProvider2 {
catch (Exception ex) {
/// unable to load original revision, use the current instead
/// This could happen in case if rebasing.
mergeData.ORIGINAL = file.contentsToByteArray();
try {
mergeData.ORIGINAL = file.contentsToByteArray();
}
catch (IOException e) {
LOG.error(e);
mergeData.ORIGINAL = ArrayUtil.EMPTY_BYTE_ARRAY;
}
}
mergeData.CURRENT = loadRevisionCatchingErrors(current);
mergeData.LAST = loadRevisionCatchingErrors(last);