Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-16301

Error when search results contain an attachment with MIME type "/"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Medium
    • None
    • 2.10.2
    • Search - Core
    • Application Server: Apache Tomcat/5.5.20
      javaVersion: 1.5.0_15
      javaRuntime: Java(TM) 2 Runtime Environment, Standard Edition
      operatingSystem: SunOS 5.10

    Description

      When searching, if the search results contain attachment(s) which happen to have MIME type of "/" Confluence throws a stack trace with a root cause of Caused by: java.util.NoSuchElementException
      at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
      at com.atlassian.confluence.util.actions.ContentTypesDisplayMapper.getIconForAttachment(ContentTypesDisplayMapper.java:116)
      ...

      To be exact:
      StringTokenizer tokenizer = new StringTokenizer(contentType, "/");
      String mainType = tokenizer.nextToken();

      It should be checked if there is a token to be found before accessing it.

      Attachments

        Activity

          People

            shaffenden Steve Haffenden (Inactive)
            7832dace4dec Juha Leppälä
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: