提交 2281ccb5 编写于 作者: M mindless

avoid NPE if null href given to hyperlinkMatchesCurrentPage


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31701 71c3de6d-444a-0410-be80-ed276b4c234a
上级 eabb58f4
......@@ -1139,7 +1139,7 @@ public class Functions {
*/
public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException {
String url = Stapler.getCurrentRequest().getRequestURL().toString();
if (href.length() <= 1) return href.equals(".") && url.endsWith("/");
if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/");
url = URLDecoder.decode(url,"UTF-8");
href = URLDecoder.decode(href,"UTF-8");
if (url.endsWith("/")) url = url.substring(0, url.length() - 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册