diff options
author | Robin Rosenberg | 2013-04-15 19:44:33 +0000 |
---|---|---|
committer | Matthias Sohn | 2013-04-15 19:56:02 +0000 |
commit | 3535a3e37bca6fee8f69c4d4592d7895f6d08db7 (patch) | |
tree | 1ea54dc470f2315c63a4d65e0ab931e5c3a2d6a8 /org.eclipse.egit.ui | |
parent | 5fac3dc56e33ca38d5cd1983bf3471a63d713f2a (diff) | |
download | egit-3535a3e37bca6fee8f69c4d4592d7895f6d08db7.tar.gz egit-3535a3e37bca6fee8f69c4d4592d7895f6d08db7.tar.xz egit-3535a3e37bca6fee8f69c4d4592d7895f6d08db7.zip |
[findbugs] Fix potential NPE in FileDiff
Not likely, but try to handle gracefully if it does happen
Change-Id: If2533df563171ba216f732a40a8ff912617bf8da
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java index 1f12934233..329fad504b 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java @@ -239,6 +239,8 @@ public class FileDiff extends WorkbenchAdapter { IWorkspaceRoot root = workspace.getRoot(); IPath absolutePath = new Path(db.getWorkTree().getAbsolutePath()).append(repoPath); IResource resource = root.getFileForLocation(absolutePath); + if (resource == null) + return null; return resource.getProjectRelativePath().toString(); } |