- final var inputStream = dependencies.getMessageReceiver().retrieveSticker(packId.serialize(), packKey, id);
- context.getStickerPackStore().storeSticker(packId, id, o -> IOUtils.copyStream(inputStream, o));
+ try (final var inputStream = messageReceiver.retrieveSticker(packId.serialize(), packKey, id)) {
+ context.getStickerPackStore().storeSticker(packId, id, o -> IOUtils.copyStream(inputStream, o));
+ }