363381 Throw IllegalStateException if Request uri is null on getServerName

This commit is contained in:
Jan Bartel 2011-11-15 14:43:09 +11:00
parent ab12d04527
commit 8458df32cb
1 changed files with 3 additions and 0 deletions

View File

@ -988,6 +988,9 @@ public class Request implements HttpServletRequest
// Return already determined host
if (_serverName != null)
return _serverName;
if (_uri == null)
throw new IllegalStateException("No uri");
// Return host from absolute URI
_serverName = _uri.getHost();