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

Average ratings manipulation is failing if there is an average rating object with number higher than 1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 15.5-rc-1, 14.10.13
    • 12.9-rc-1
    • Ratings
    • None
    • Unknown
    • N/A
    • N/A

    Description

      When manipulating objects, the xobject average ratings manager is not checking objects for null, here: https://github.com/xwiki/xwiki-platform/blob/61a67f5cf241df692779d77367168e0762119091/xwiki-platform-core/xwiki-platform-ratings/xwiki-platform-ratings-api/src/main/java/org/xwiki/ratings/internal/averagerating/XObjectAverageRatingManager.java#LL238C25-L238C32 .

      So, in the very special case when the only ratings object exists and has number 1, it will fail with a NullPointerException.

      Note: this can happen during the automatic migration of ratings upon upgrade of an XWiki and will fail the migration of the XWiki database.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              lucaa Anca Luca
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: