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
- is caused by
-
XWIKI-17761 Provide a new API for Ratings to allow create a RatingManager with a dedicated scale
- Closed