diff --git a/src/main/java/org/asamk/signal/commands/GetAttachmentCommand.java b/src/main/java/org/asamk/signal/commands/GetAttachmentCommand.java index cf716194..c640ee83 100644 --- a/src/main/java/org/asamk/signal/commands/GetAttachmentCommand.java +++ b/src/main/java/org/asamk/signal/commands/GetAttachmentCommand.java @@ -41,6 +41,9 @@ public class GetAttachmentCommand implements JsonRpcLocalCommand { ) throws CommandException { final var id = ns.getString("id"); + if (id == null) { + throw new UserErrorException("Missing attachment id parameter"); + } try (InputStream attachment = m.retrieveAttachment(id)) { final var bytes = attachment.readAllBytes();