diff --git a/server/src/com/mirth/connect/connectors/file/FileConnectorServlet.java b/server/src/com/mirth/connect/connectors/file/FileConnectorServlet.java index 66b09cf80..abef74c2c 100644 --- a/server/src/com/mirth/connect/connectors/file/FileConnectorServlet.java +++ b/server/src/com/mirth/connect/connectors/file/FileConnectorServlet.java @@ -65,7 +65,12 @@ protected ConnectionTestResponse testReadOrWrite(String channelId, String channe int timeout = Integer.parseInt(timeoutString); FileConnector fileConnector = new FileConnector(channelId, connectorProperties, null); - URI address = fileConnector.getEndpointURI(host, scheme, schemeProperties, secure); + URI address; + try { + address = fileConnector.getEndpointURI(host, scheme, schemeProperties, secure); + } catch (Exception e) { + return new ConnectionTestResponse(ConnectionTestResponse.Type.FAILURE, "Unable to parse URL, Reason: " + e.getMessage()); + } String addressHost = address.getHost(); int port = address.getPort(); String dir = address.getPath();