{"thread":{"id":"12038","subject":"[EGIT PATCH] egit.core: Handling mapping unavaiable","startedAt":"2008-02-11T17:06:25Z","lastAt":"2008-02-11T17:06:25Z","messageCount":1,"participants":["Shunichi Fuji"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"68411","messageId":"20080212020625.d33eded5.palglowr@gmail.com","threadId":"12038","inReplyTo":null,"subject":"[EGIT PATCH] egit.core: Handling mapping unavaiable","fromName":"Shunichi Fuji","fromEmail":"palglowr@gmail.com","sentAt":"2008-02-11T17:06:25Z","receivedAt":"2008-02-11T17:06:25Z","isPatch":true,"sender":{"key":"palglowr@gmail.com","avatar":null},"body":"\n Check whether IResource.getProject returned the workspace root.\n\nSigned-off-by: Shunichi Fuji <palglowr@gmail.com>\n---\n .../egit/core/project/RepositoryMapping.java       |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --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\nindex 754a172..383cb8b 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java\n@@ -267,13 +267,16 @@ public class RepositoryMapping {\n \t}\n \n \t/**\n-\t * Get the repository mappping for a resource\n+\t * Get the repository mapping for a resource\n \t *\n \t * @param resource\n-\t * @return the RepositoryMapping for this resource\n+\t * @return the RepositoryMapping for this resource,\n+\t *         or null for non GitProvider.\n \t */\n \tpublic static RepositoryMapping getMapping(IResource resource) {\n \t\tIProject project = resource.getProject();\n+\t\tif (project == null)\n+\t\t\treturn null;\n \t\tRepositoryProvider provider = RepositoryProvider.getProvider(project);\n \t\tif (!(provider instanceof GitProvider))\n \t\t\treturn null;\n-- \n1.5.4\n"}]}