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

[EGIT PATCH] Avoid NPE in QuickDiffProvider

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Apr 27, 2009, 22:52 UTC
Message-ID
<1240872734-15261-1-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../internal/decorators/GitQuickDiffProvider.java  |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitQuickDiffProvider.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitQuickDiffProvider.java
index 91efb56..b2d48cd 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitQuickDiffProvider.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitQuickDiffProvider.java
@@ -59,6 +59,8 @@ public String getId() {
 	public IDocument getReference(IProgressMonitor monitor)
 			throws CoreException {
 		Activator.trace("(GitQuickDiffProvider) file: " + resource);
+		if (resource == null)
+			return null;
 		RepositoryProvider provider = RepositoryProvider.getProvider(resource
 				.getProject());
 		if (provider != null) {
-- 
1.6.3.rc2.9.gc9550
Message 1 of 1 in “Avoid NPE in QuickDiffProvider”
  1. Avoid NPE in QuickDiffProviderRobin Rosenberg, Apr 27, 2009

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.