X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FAbstractSoneCommand.java;h=a47bde3f4dbd57a732c7d508ada301301d57c7e9;hp=93b5d322e13ab28e37891420037fd41114a67ba6;hb=fafe0029dcbef27ce918fdf7007e78c8705ca20f;hpb=d920774a69518c31b5e66d36b830bcf95a5ec237 diff --git a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java index 93b5d32..a47bde3 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java @@ -210,11 +210,11 @@ public abstract class AbstractSoneCommand extends AbstractCommand { protected PostReply getReply(SimpleFieldSet simpleFieldSet, String parameterName) throws FcpException { try { String replyId = simpleFieldSet.getString(parameterName); - Optional reply = core.getPostReply(replyId); - if (!reply.isPresent()) { + PostReply reply = core.getPostReply(replyId); + if (reply == null) { throw new FcpException("Could not load reply from “" + replyId + "”."); } - return reply.get(); + return reply; } catch (FSParseException fspe1) { throw new FcpException("Could not reply ID from “" + parameterName + "”.", fspe1); }