From 4b9f0443cb0e35747e0c4ec5f416175b42164a60 Mon Sep 17 00:00:00 2001 From: Robert Joseph Evans Date: Fri, 28 Dec 2012 14:21:07 +0000 Subject: [PATCH] YARN-225. Proxy Link in RM UI thows NPE in Secure mode (Devaraj K via bobby) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1426515 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/webproxy/WebAppProxyServlet.java | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 991f78d9fbc..ed4f895cfac 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -248,6 +248,9 @@ Release 0.23.6 - UNRELEASED YARN-280. RM does not reject app submission with invalid tokens (Daryn Sharp via tgraves) + YARN-225. Proxy Link in RM UI thows NPE in Secure mode + (Devaraj K via bobby) + Release 0.23.5 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java index 3e43351b4ba..7f6bba14e98 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java @@ -254,11 +254,14 @@ public class WebAppProxyServlet extends HttpServlet { if(securityEnabled) { String cookieName = getCheckCookieName(id); - for(Cookie c: req.getCookies()) { - if(cookieName.equals(c.getName())) { - userWasWarned = true; - userApproved = userApproved || Boolean.valueOf(c.getValue()); - break; + Cookie[] cookies = req.getCookies(); + if (cookies != null) { + for (Cookie c : cookies) { + if (cookieName.equals(c.getName())) { + userWasWarned = true; + userApproved = userApproved || Boolean.valueOf(c.getValue()); + break; + } } } }