Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25562

Making a request for a download of a page without an attached file causes NPE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 18.8.0
    • Old Core
    • None
    • Ubuntu 24.04.4, Chrome Version 154.0.8, local XWiki Jetty 18.8.0
    • Unknown

    Description

      STEPS TO REPRODUCE
      1. Run a XWiki 18.8.0
      2. Request the download URL of an existing page without a file name:

      http://localhost:8080/xwiki/bin/download/Sandbox/TestPage3

      To clarify the expectations:

      • when requesting the view of a page, /bin/view/Main/ returns 302 (normal).
      • when requesting the download URL of a non-existing attached file, /bin/download/Main/WebHome/nosuchfile.png returns 404 (normal).

      EXPECTED RESULTS
      The "attachment not found" response (404), or the redirection filter ignores the URL.

      ACTUAL RESULTS
      Actual: Shown error is

      Caused by: java.lang.NullPointerException: Cannot read field "parent" because "reference" is null
      

      and an "Uncaught exception" warning in the log:

      plus error 500 in the console:

      Attachments

        Activity

          People

            Unassigned Unassigned
            AndreeaChirica Andreea Bran
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: