diff options
Diffstat (limited to 'document/src/main/java/com/yahoo/document/idstring/IdIdString.java')
-rw-r--r-- | document/src/main/java/com/yahoo/document/idstring/IdIdString.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/document/src/main/java/com/yahoo/document/idstring/IdIdString.java b/document/src/main/java/com/yahoo/document/idstring/IdIdString.java index 7fcb530b347..44ff08c73f0 100644 --- a/document/src/main/java/com/yahoo/document/idstring/IdIdString.java +++ b/document/src/main/java/com/yahoo/document/idstring/IdIdString.java @@ -62,6 +62,9 @@ public class IdIdString extends IdString { if (hasSetLocation) { throw new IllegalArgumentException("Illegal key combination in " + keyValues); } + if (value.isEmpty()) { + throw new IllegalArgumentException("ID location value for 'n=' key is empty"); + } location = Long.parseLong(value); hasSetLocation = true; hasNumber = true; @@ -70,6 +73,9 @@ public class IdIdString extends IdString { if (hasSetLocation) { throw new IllegalArgumentException("Illegal key combination in " + keyValues); } + if (value.isEmpty()) { + throw new IllegalArgumentException("ID location value for 'g=' key is empty"); + } location = makeLocation(value); hasSetLocation = true; hasGroup = true; |