Uncatched null pointer in URLConnection.getContent()

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.3.0
    • Component/s: core-libs
    • x86
    • windows_nt



      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)
      ======================================================================

            Assignee:
            Michael McMahon
            Reporter:
            Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: