Skip to content

Commit

Permalink
check null for path before call rest server (#3665)
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj authored and beiwei30 committed Mar 15, 2019
1 parent 70898ef commit 5e6cbbe
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,17 @@ public void destroy() {
*/
protected String getContextPath(URL url) {
String contextPath = url.getPath();
if (contextPath.equalsIgnoreCase(url.getParameter(Constants.INTERFACE_KEY))) {
if (contextPath != null) {
if (contextPath.equalsIgnoreCase(url.getParameter(Constants.INTERFACE_KEY))) {
return "";
}
if (contextPath.endsWith(url.getParameter(Constants.INTERFACE_KEY))) {
contextPath = contextPath.substring(0, contextPath.lastIndexOf(url.getParameter(Constants.INTERFACE_KEY)));
}
return contextPath.endsWith("/") ? contextPath.substring(0, contextPath.length() - 1) : contextPath;
} else {
return "";
}
if (contextPath.endsWith(url.getParameter(Constants.INTERFACE_KEY))) {
contextPath = contextPath.substring(0, contextPath.lastIndexOf(url.getParameter(Constants.INTERFACE_KEY)));
}
return contextPath.endsWith("/") ? contextPath.substring(0, contextPath.length() - 1) : contextPath;
}

protected class ConnectionMonitor extends Thread {
Expand Down

0 comments on commit 5e6cbbe

Please sign in to comment.