From d2656029c5afa360db99426bcd34ecfb186ae525 Mon Sep 17 00:00:00 2001 From: irengrig Date: Tue, 20 Sep 2011 15:23:55 +0400 Subject: [PATCH] NPE for git log when no tracked branch is specified --- .../src/git4idea/history/browser/LowLevelAccessImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));