diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java index 3d700ac49..a9522452b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java @@ -378,12 +378,15 @@ public abstract class ObjectInserter { w.write(tag.getTag()); w.write("\n"); - w.write("tagger "); - w.write(tag.getTagger().toExternalString()); - w.write('\n'); + if (tag.getTagger() != null) { + w.write("tagger "); + w.write(tag.getTagger().toExternalString()); + w.write('\n'); + } w.write('\n'); - w.write(tag.getMessage()); + if (tag.getMessage() != null) + w.write(tag.getMessage()); w.close(); } catch (IOException err) { // This should never occur, the only way to get it above is