Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332934 - NPE in history view when deleted project is selected
Summary: NPE in history view when deleted project is selected
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Philipp Thun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-20 06:51 EST by Tobias Oberlies CLA
Modified: 2011-04-04 05:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Oberlies CLA 2010-12-20 06:51:38 EST
Build Identifier: EGit 0.9.3

Somehow I seem to have a talent to find these corner cases... I tried to work with the history just after deleting the corresponding project, and this gave an NPE:

Error
Mon Dec 20 11:51:40 CET 2010
Unhandled event loop exception

java.lang.NullPointerException
at org.eclipse.egit.ui.internal.history.command.AbstractHistoryCommanndHandler.getRepository(AbstractHistoryCommanndHandler.java:145)
at org.eclipse.egit.ui.internal.history.command.ResetHandler.execute(ResetHandler.java:31)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:820)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:806)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:796)
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:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)



Reproducible: Always

Steps to Reproduce:
1. Close all editors, open the history view, select a shared project
2. Close the project
3. Delete the project; the history view still shows the history
4. Select a commit an choose Reset > Hard

Just in case this matters, the view was in the following mode: "Link with Editor and Selection", "Show find Toolbar", "Show all changes in Repository...".
Comment 1 Philipp Thun CLA 2011-03-04 04:42:53 EST
Today I saw a similar error. After closing and removing a Git repository (that was shown in the history view before), I got the following error when clicking on commits in the - still opened - history view:

org.eclipse.jgit.errors.MissingObjectException: Missing tree 44437440099c8757aaf0637567c98afb8c0945af
	at org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:118)
	at org.eclipse.jgit.treewalk.CanonicalTreeParser.reset(CanonicalTreeParser.java:193)
	at org.eclipse.jgit.treewalk.TreeWalk.parserFor(TreeWalk.java:982)
...

When clicking on an entry in the file list belonging to a commit the error is different:

org.eclipse.jgit.errors.MissingObjectException: Missing blob 08bb2331e777f431177c40df6841c0034f89fb58
	at org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:118)
	at org.eclipse.jgit.diff.ContentSource$ObjectReaderSource.open(ContentSource.java:146)
	at org.eclipse.jgit.diff.ContentSource$Pair.open(ContentSource.java:329)
...
Comment 2 Philipp Thun CLA 2011-03-28 09:19:32 EDT
Fix proposed: http://egit.eclipse.org/r/2945
Comment 3 Philipp Thun CLA 2011-04-04 05:04:41 EDT
Fixed in nightly build.