Skip to content

Commit 7178846

Browse files
mgaffigantonygermano
authored andcommitted
Avoid crash when invalid URI is passed to test file write
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
1 parent 8e51433 commit 7178846

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/com/mirth/connect/connectors/file/FileConnectorServlet.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ protected ConnectionTestResponse testReadOrWrite(String channelId, String channe
6565
int timeout = Integer.parseInt(timeoutString);
6666

6767
FileConnector fileConnector = new FileConnector(channelId, connectorProperties, null);
68-
URI address = fileConnector.getEndpointURI(host, scheme, schemeProperties, secure);
68+
URI address;
69+
try {
70+
address = fileConnector.getEndpointURI(host, scheme, schemeProperties, secure);
71+
} catch (Exception e) {
72+
return new ConnectionTestResponse(ConnectionTestResponse.Type.FAILURE, "Unable to parse URL, Reason: " + e.getMessage());
73+
}
6974
String addressHost = address.getHost();
7075
int port = address.getPort();
7176
String dir = address.getPath();

0 commit comments

Comments
 (0)