From: David ‘Bombe’ Roden Date: Mon, 4 Nov 2013 20:51:32 +0000 (+0100) Subject: Actually allow the Sone to be missing in getOptionalSone(). X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=ef0125664737bbf8e14f3a6960c30d4f289ccce5 Actually allow the Sone to be missing in getOptionalSone(). --- diff --git a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java index a66fdae..62d6a53 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java @@ -119,8 +119,8 @@ public abstract class AbstractSoneCommand extends AbstractCommand { } protected Optional getOptionalSone(SimpleFieldSet simpleFieldSet, String parameterName) throws FcpException { - String soneId = getMandatoryParameter(simpleFieldSet, parameterName); - return core.getSone(soneId); + String soneId = getString(simpleFieldSet, parameterName, null); + return (soneId == null) ? Optional.absent() : core.getSone(soneId); } protected Sone getMandatoryLocalSone(SimpleFieldSet simpleFieldSet, String parameterName) throws FcpException {