Name: skT45625 Date: 08/09/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
java.lang.NullPointerException
at java.net.URLConnection.stripOffParameters(URLConnection.java:1016)
at java.net.URLConnection.getContentHandler(URLConnection.java:984)
at java.net.URLConnection.getContent(URLConnection.java:559)
The code at 984 is:
String contentType = stripOffParameters(getContentType());
ContentHandler handler = null;
if (contentType == null) // <=== SIGH! Too late
throw new UnknownServiceException("no content-type");
stripOffParameters goes:
int index = contentType.indexOf(';');
which throws the NULLPointerException
(Review ID: 108152)
======================================================================
- duplicates
-
JDK-4278840 URLConnection.getContent() throws NullPointerException
-
- Resolved
-