diff --git a/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java b/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java index 3e04c9d90eb2..3a0f2ed4b703 100644 --- a/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java +++ b/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java @@ -120,8 +120,8 @@ public class LowLevelAccessImpl implements LowLevelAccess { refs.setCurrent(current); if (current != null) { GitBranch tracked = current.tracked(myProject, myRoot); - String fullName = tracked.getFullName(); - fullName = fullName.startsWith(GitBranch.REFS_REMOTES_PREFIX) ? fullName.substring(GitBranch.REFS_REMOTES_PREFIX.length()) : fullName; + String fullName = tracked == null ? null : tracked.getFullName(); + fullName = fullName != null && fullName.startsWith(GitBranch.REFS_REMOTES_PREFIX) ? fullName.substring(GitBranch.REFS_REMOTES_PREFIX.length()) : fullName; refs.setTrackedRemote(fullName); } refs.setUsername(GitConfigUtil.getValue(myProject, myRoot, GitConfigUtil.USER_NAME));