* [EGIT PATCH] egit.core: Handling mapping unavaiable
@ 2008-02-11 17:06 Shunichi Fuji
0 siblings, 0 replies; only message in thread
From: Shunichi Fuji @ 2008-02-11 17:06 UTC (permalink / raw)
To: git
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-11 17:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-11 17:06 [EGIT PATCH] egit.core: Handling mapping unavaiable Shunichi Fuji
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.