[PATCH EGIT] Fix NPE on move/delete ignored file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Daniel Cheng (aka SDiZ) git@xxxxxxxx <git@xxxxxxxx>
---

When I rename a class, it give out NPE. I *guess* this is related
to ignored resource, as it was called from BatchImageBuilder.cleanOutputFolders().
This patch mask the NPE.

!ENTRY org.eclipse.core.resources 2 75 2009-04-27 15:34:25.873
!MESSAGE Errors during build.
!SUBENTRY 1 org.eclipse.jdt.core 2 75 2009-04-27 15:34:25.874
!MESSAGE Errors running builder 'Java Builder' on project 'fred'.
!SUBENTRY 1 org.eclipse.jdt.core 2 75 2009-04-27 15:34:25.874
!MESSAGE null argument:
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: null argument:
    at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:86)
    at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:74)
    at org.spearce.egit.core.GitMoveDeleteHook.<init>(GitMoveDeleteHook.java:40)
    at org.spearce.egit.core.GitProvider.getMoveDeleteHook(GitProvider.java:55)
    at org.eclipse.team.internal.core.MoveDeleteManager.getHookFor(MoveDeleteManager.java:34)
    at org.eclipse.team.internal.core.MoveDeleteManager.deleteFolder(MoveDeleteManager.java:62)
    at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1723)
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:711)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:114)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:46)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:178)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)                                           at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)




 .../src/org/spearce/egit/core/GitProvider.java     |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java
index c7baf65..db3a857 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java
@@ -52,7 +52,9 @@ public boolean canHandleLinkedResourceURI() {
 
 	public synchronized IMoveDeleteHook getMoveDeleteHook() {
 		if (hook == null) {
-			hook = new GitMoveDeleteHook(getData());
+			GitProjectData _data = getData();
+			if (_data != null)
+				hook = new GitMoveDeleteHook(_data);
 		}
 		return hook;
 	}
-- 
1.6.2.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]