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

Bug 354495

Summary: NPE thrown when trying to create a patch
Product: [Technology] EGit Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Remy Suen CLA 2011-08-11 09:43:45 EDT
I selected the first commit in the 'History' view and tried to use 'Create Patch...' from its context menu. I selected the 'Clipboard' option and then clicked 'Finish' but nothing happened. The exception below was in my log file.

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard.performFinish(GitCreatePatchWizard.java:141)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard.run(GitCreatePatchWizard.java:101)
	at org.eclipse.egit.ui.internal.history.command.CreatePatchHandler.execute(CreatePatchHandler.java:34)

Caused by: java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.history.FileDiff.getProjectRelativePath(FileDiff.java:228)
	at org.eclipse.egit.ui.internal.history.FileDiff.outputEclipseDiff(FileDiff.java:181)
	at org.eclipse.egit.ui.internal.history.FileDiff.outputDiff(FileDiff.java:168)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard$1.run(GitCreatePatchWizard.java:169)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.history.FileDiff.getProjectRelativePath(FileDiff.java:228)
	at org.eclipse.egit.ui.internal.history.FileDiff.outputEclipseDiff(FileDiff.java:181)
	at org.eclipse.egit.ui.internal.history.FileDiff.outputDiff(FileDiff.java:168)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard$1.run(GitCreatePatchWizard.java:169)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Remy Suen CLA 2011-08-11 09:54:38 EDT
I think this might be because the only file I have changed in this commit is a file that's not in the workspace.
Comment 2 Kevin Sawicki CLA 2011-08-15 12:08:50 EDT
I believe this is a duplicate of bug343276

*** This bug has been marked as a duplicate of bug 343276 ***