git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH] egit.core: Handling mapping unavaiable

From
SFShunichi Fuji <palglowr@gmail.com>
Date
Feb 11, 2008, 17:06 UTC
Message-ID
<20080212020625.d33eded5.palglowr@gmail.com>
 Check whether IResource.getProject returned the workspace root.
Signed-off-by: Shunichi Fuji <palglowr@gmail.com>
---
 .../egit/core/project/RepositoryMapping.java       |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
index 754a172..383cb8b 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
@@ -267,13 +267,16 @@ public class RepositoryMapping {
 	}
 
 	/**
-	 * Get the repository mappping for a resource
+	 * Get the repository mapping for a resource
 	 *
 	 * @param resource
-	 * @return the RepositoryMapping for this resource
+	 * @return the RepositoryMapping for this resource,
+	 *         or null for non GitProvider.
 	 */
 	public static RepositoryMapping getMapping(IResource resource) {
 		IProject project = resource.getProject();
+		if (project == null)
+			return null;
 		RepositoryProvider provider = RepositoryProvider.getProvider(project);
 		if (!(provider instanceof GitProvider))
 			return null;
-- 
1.5.4
Message 1 of 1 in “egit.core: Handling mapping unavaiable”
  1. egit.core: Handling mapping unavaiableShunichi Fuji, Feb 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.