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

Initialization of WikiObjectComponentBuilder based wiki components fail when one of the xobject is null

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      In this code

         private void unRegisterObjectComponents(XWikiDocument document)
          {
              for (Map.Entry<DocumentReference, List<BaseObject>> entry : document.getXObjects().entrySet()) {
                  WikiObjectComponentBuilder componentBuilder = getAssociatedComponentBuilder(entry.getKey());
      
                  if (componentBuilder != null) {
                      for (BaseObject baseObject : entry.getValue()) {
                          if (baseObject != null) {
                              this.wikiObjectComponentManagerEventListenerProxy
                                  .unregisterObjectComponents(baseObject.getReference());
                          }
                      }
                  }
              }
          }
      

       
      in
      https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-component/xwiki-platform-component-wiki/src/main/java/org/xwiki/component/wiki/internal/bridge/DefaultWikiObjectComponentManagerEventListener.java

      entry can be null if the component object is not at rank "0" which is possible.
      In this case the component loading will stop and fail

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmortagne Thomas Mortagne
                Reporter:
                ludovic Ludovic Dubost
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: