From: markt Date: Fri, 4 Jan 2008 20:59:59 +0000 (+0000) Subject: Fix possible NPE when no ROOT application is deployed in fix for bug 43839. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e0db9a09ec6a5525c615227800ac575f4b7e1792;p=tomcat7.0 Fix possible NPE when no ROOT application is deployed in fix for bug 43839. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@609003 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java index a22e542ff..e3ce60b5e 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -551,7 +551,8 @@ public class CoyoteAdapter // context, don't go looking for a session ID in a cookie as a cookie // from a parent context with a session ID may be present which would // overwrite the valid session ID encoded in the URL - if (!((Context)request.getMappingData().context).getCookies()) + Context context = (Context) request.getMappingData().context; + if (context != null && !context.getCookies()) return; // Parse session id from cookies