Check for missing attachment id

Closes #1989
This commit is contained in:
AsamK 2026-04-02 22:06:10 +02:00
parent d40f62ec21
commit e6b33b8da7

View File

@ -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();