Details
-
Bug
-
Resolution: Fixed
-
Minor
-
11.7-rc-1, 11.6.1
-
None
-
Unknown
-
N/A
-
N/A
-
Description
As reported in this forum thread / post:
https://forum.xwiki.org/t/help-with-update/5227/8
the ScopeNotificationFilterClassMigrator might throw an NPE while migrating with a stack trace like:
Caused by: java.lang.NullPointerException at org.xwiki.notifications.filters.internal.migrators.ScopeNotificationFilterClassMigrator.generateNewXObject(ScopeNotificationFilterClassMigrator.java:169) at org.xwiki.notifications.filters.internal.migrators.ScopeNotificationFilterClassMigrator.migrateDocument(ScopeNotificationFilterClassMigrator.java:152) at org.xwiki.notifications.filters.internal.migrators.ScopeNotificationFilterClassMigrator.hibernateMigrate(ScopeNotificationFilterClassMigrator.java:125) at com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:118) at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:837) at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:736) at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:657)
I can reproduce the issue when I try to migrate a database from XWiki 9.7 while having some objects of class ##XWiki.Notifications.Code.NotificationPreferenceScopeClass## deleted manually from some user preferences pages.
A simple null check should fix the issue.