From d4f00a3df8b3167d831d967310b2375d8b2d515a Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 26 Feb 2017 11:05:14 +0000 Subject: [PATCH] Fail safe in case of "conflict not found" issue during git merge assertTrue just logs the message and doesn't prevent the NPE on the next line. --- plugins/git4idea/src/git4idea/merge/GitMergeProvider.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java b/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java index fc82b74c29ee..ecc6fb3b709c 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java @@ -464,8 +464,11 @@ public class GitMergeProvider implements MergeProvider2 { for (VirtualFile f : files) { String path = VcsFileUtil.relativePath(root, f); Conflict c = cs.get(path); - LOG.assertTrue(c != null, String.format("The conflict not found for file: %s(%s)%nFull ls-files output: %n%s%nAll files: %n%s", - f.getPath(), path, output, files)); + if (c == null) { + LOG.error(String.format("The conflict not found for file: %s(%s)%nFull ls-files output: %n%s%nAll files: %n%s", + f.getPath(), path, output, files)); + continue; + } c.myFile = f; if (c.myStatusTheirs == null) { c.myStatusTheirs = Conflict.Status.DELETED;