Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 396416

Summary: NPE in GitModelSynchronizeParticipant.asCompareInput
Product: [Technology] EGit Reporter: Michael Scharf <eclipse>
Component: UIAssignee: Robin Stocker <robin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: robin
Version: 2.2   
Target Milestone: 2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The full stack trace none

Description Michael Scharf CLA 2012-12-12 10:08:00 EST
Created attachment 224631 [details]
The full stack trace

When I double click in the syncronize perspective on a difference I get the following exception.

I am using EGit 2.2.0.201212042214	

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.synchronize.GitModelSynchronizeParticipant.asCompareInput(GitModelSynchronizeParticipant.java:220)
	at org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction.openCompareEditor(OpenInCompareAction.java:113)
	at org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction.run(OpenInCompareAction.java:68)
	at
Comment 1 Robin Stocker CLA 2012-12-12 11:45:16 EST
Could you describe the steps to reproduce the problem? I tried a few things but could not reproduce it. E.g. how did you start the synchronization, what is the project and repository structure, what kind of change is it.

The NPE itself is easy to fix but maybe the root cause is another problem, in which case it would be useful to know.
Comment 2 Michael Scharf CLA 2012-12-12 16:41:50 EST
I cannot reproduce it either... But it happened several times to me. If it happens again I'll try to reproduce it.
Comment 3 Robin Stocker CLA 2012-12-13 05:22:48 EST
Ok, here's the fix for the NPE:

https://git.eclipse.org/r/9215
Comment 5 Michael Scharf CLA 2012-12-13 12:32:11 EST
Ah, from the changes I can tell you what goes wrong:

I am working a a bigger project where I add out only a few projects onto my workspace. I think the problem comes when a change contains files in git which are not part of the workspace. 


See also bug 395041