Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-1018

Fix NullPointerException when previewing a folder

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.32
    • Fix Version/s: 2.2.35
    • Component/s: UI, Widgets

      Description

      Steps to reproduce:

      1. In a Workspace, click on the + button
      2. Choose the File document type
      3. Fill the Title field and leave the other fields blank
      4. Click the Create button
      5. The document view is displayed
      6. Observe that an exception has been generated in the logs
      2019-08-09 10:13:44,991 ERROR [WebEngineExceptionMapper] java.lang.NullPointerException
      java.lang.NullPointerException
      	at org.nuxeo.ecm.restapi.server.jaxrs.adapters.PreviewAdapter.preview(PreviewAdapter.java:75)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
      	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ObjectOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:258)
      	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
       

      According to my investigation, it has been introduced by NXP-27414 (when ELEMENTS-591 has been backported to 9.10) when a check on a null blob has been removed: https://github.com/nuxeo/nuxeo-ui-elements/pull/402/commits/e04245393d4ead169558705d03c6c1359bb06180#diff-b108707615ef2f8ffbb6a0010c0f718cL209

      Expected behavior: no exception is logged

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h