Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-11567

Drive: possible NPE on parent FileSystemItem when adapting a document

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.0-HF18, 5.7.1
    • Component/s: Nuxeo Drive

      Description

      When adapting a document through the DefaultFileSystemItemFactory, the following code might cause a NPE if the parent document cannot be adapted:

      FileSystemItem parent = getFileSystemItemAdapterService().getFileSystemItem(
                          parentDoc, true);
      // TODO: handle NPE on parent
      parentId = parent.getId();
      

      Stack trace in this case:

      Caused by: java.lang.NullPointerException
      	at org.nuxeo.drive.adapter.impl.AbstractDocumentBackedFileSystemItem.<init>(AbstractDocumentBackedFileSystemItem.java:86)
      	at org.nuxeo.drive.adapter.impl.DocumentBackedFileItem.<init>(DocumentBackedFileItem.java:55)
      	at org.nuxeo.drive.service.impl.DefaultFileSystemItemFactory.adaptDocument(DefaultFileSystemItemFactory.java:158)
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h