From: Shunichi Fuji <palglowr@gmail.com>
To: git@vger.kernel.org
Subject: [EGIT PATCH] egit.core: Handling mapping unavaiable
Date: Tue, 12 Feb 2008 02:06:25 +0900 [thread overview]
Message-ID: <20080212020625.d33eded5.palglowr@gmail.com> (raw)
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
reply other threads:[~2008-02-11 17:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080212020625.d33eded5.palglowr@gmail.com \
--to=palglowr@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.