From 125eefed6e85b36c99066f0515d03de073f13a9b Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 13 Jan 2023 16:06:17 +0100 Subject: [PATCH] Fix IOException when trying to close already-closed output stream --- external-sop/src/main/java/sop/external/ExternalSOP.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/external-sop/src/main/java/sop/external/ExternalSOP.java b/external-sop/src/main/java/sop/external/ExternalSOP.java index 5cf0716..30154cd 100644 --- a/external-sop/src/main/java/sop/external/ExternalSOP.java +++ b/external-sop/src/main/java/sop/external/ExternalSOP.java @@ -301,7 +301,11 @@ public class ExternalSOP implements SOP { } standardIn.close(); - processOut.close(); + try { + processOut.close(); + } catch (IOException e) { + // ignore + } while ((r = processIn.read(buf)) > 0) { outputStream.write(buf, 0 , r);