Skip to content

Commit 02eefd9

Browse files
committed
Throw early if control OID is not present.
1 parent 1ec993a commit 02eefd9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/main/java/org/ldaptive/AbstractMessage.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,12 @@ public void handle(final DERParser parser, final DERBuffer encoded)
171171
{
172172
final ControlParser p = new ControlParser();
173173
p.parse(encoded);
174+
if (p.getOid().isEmpty()) {
175+
throw new IllegalArgumentException("Cannot parse response control without OID");
176+
}
174177
getObject().addControls(
175178
ControlFactory.createResponseControl(
176-
p.getOid().isPresent() ? p.getOid().get() : null,
179+
p.getOid().get(),
177180
p.getCritical().isPresent() ? p.getCritical().get() : false,
178181
p.getValue().isPresent() ? p.getValue().get() : null));
179182
}

0 commit comments

Comments
 (0)