From ca3871e2234614f933dce54abceaef1dd693f698 Mon Sep 17 00:00:00 2001 From: AsamK Date: Tue, 15 Jun 2021 23:15:36 +0200 Subject: [PATCH] Handle missing captcha parameter correctly Fixes #644 --- src/main/java/org/asamk/signal/commands/RegisterCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/asamk/signal/commands/RegisterCommand.java b/src/main/java/org/asamk/signal/commands/RegisterCommand.java index 971e4dd1..1b7e5ef9 100644 --- a/src/main/java/org/asamk/signal/commands/RegisterCommand.java +++ b/src/main/java/org/asamk/signal/commands/RegisterCommand.java @@ -27,7 +27,8 @@ public class RegisterCommand implements RegistrationCommand { @Override public void handleCommand(final Namespace ns, final RegistrationManager m) throws CommandException { final boolean voiceVerification = ns.getBoolean("voice"); - final var captcha = ns.getString("captcha").replace("signalcaptcha://", ""); + final var captchaString = ns.getString("captcha"); + final var captcha = captchaString == null ? null : captchaString.replace("signalcaptcha://", ""); try { m.register(voiceVerification, captcha);