aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
index 764f890158..0e96138c00 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
@@ -49,6 +49,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import org.eclipse.jgit.annotations.Nullable;
import org.eclipse.jgit.errors.InvalidObjectIdException;
import org.eclipse.jgit.util.NB;
import org.eclipse.jgit.util.RawParseUtils;
@@ -86,7 +87,10 @@ public class ObjectId extends AnyObjectId implements Serializable {
* the string to test.
* @return true if the string can converted into an ObjectId.
*/
- public static final boolean isId(String id) {
+ public static final boolean isId(@Nullable String id) {
+ if (id == null) {
+ return false;
+ }
if (id.length() != Constants.OBJECT_ID_STRING_LENGTH)
return false;
try {