Skip to content

Commit

Permalink
[PRDP-171] add check on input stream
Browse files Browse the repository at this point in the history
  • Loading branch information
giomella committed Oct 17, 2023
1 parent 6584ac1 commit 3ab22a0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import it.gov.pagopa.receipt.pdf.generator.model.template.PSP;
import it.gov.pagopa.receipt.pdf.generator.model.template.PSPFee;

import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down Expand Up @@ -39,8 +40,11 @@ public class BizEventToPdfMapper {

static {
try (InputStream data = BizEventToPdfMapper.class.getResourceAsStream("psp_config_file.json")) {
if (data == null) {
throw new IOException("PSP config file not found");
}
pspMap = ObjectMapperUtils.mapString(new String(data.readAllBytes()), Map.class);
} catch (Exception e) {
} catch (IOException e) {
throw new PdfJsonMappingException(e);
}
}
Expand Down

0 comments on commit 3ab22a0

Please sign in to comment.