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

[PATCH 2/3] deref_tag: handle tag->tagged = NULL

From
MKMartin Koegler <mkoegler@auto.tuwien.ac.at>
Date
Feb 18, 2008, 07:31 UTC
Message-ID
<1203319916670-git-send-email-mkoegler@auto.tuwien.ac.at>
In-Reply-To
<12033199162949-git-send-email-mkoegler@auto.tuwien.ac.at>
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
 tag.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tag.c b/tag.c
index 38bf913..990134f 100644
--- a/tag.c
+++ b/tag.c
@@ -9,7 +9,10 @@ const char *tag_type = "tag";
 struct object *deref_tag(struct object *o, const char *warn, int warnlen)
 {
 	while (o && o->type == OBJ_TAG)
-		o = parse_object(((struct tag *)o)->tagged->sha1);
+		if (((struct tag *)o)->tagged)
+			o = parse_object(((struct tag *)o)->tagged->sha1);
+		else
+			o = NULL;
 	if (!o && warn) {
 		if (!warnlen)
 			warnlen = strlen(warn);
-- 
1.5.4.1.gaf0ae
Previous: Martin KoeglerNext: Martin Koegler
Message 2 of 5 in “deref_tag: handle return value NULL”
  1. 1/3 deref_tag: handle return value NULLMartin Koegler, Feb 18, 2008
  2. 2/3 deref_tag: handle tag->tagged = NULLMartin Koegler, Feb 18, 2008
  3. 3/3 check return code of prepare_revision_walkMartin Koegler, Feb 18, 2008
  4. Junio C HamanoFeb 18, 2008
  5. Junio C HamanoFeb 18, 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.