From ef0125664737bbf8e14f3a6960c30d4f289ccce5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 4 Nov 2013 21:51:32 +0100 Subject: [PATCH] Actually allow the Sone to be missing in getOptionalSone(). --- src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 { -- 2.7.4