Uploaded image for project: 'Magnolia Webhooks'
  1. Magnolia Webhooks
  2. MGNLHOOK-210

NPE when processing info.magnolia.types.ContentTypeChangeEvent events

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.0.1
    • None
    • None

      This bug affects webhooks version 1.0.0, it's already fixed on master

      It happens when a ContentTypeChangedEvent is going to be processed, and there are webhook definitions with events without entity, which is optional and shouldn't cause NPE:

       
      2022-09-06 09:47:18,185 ERROR [http-nio-8081-exec-6] info.magnolia.event.SimpleEventBus {environmentId=main}: Exception caught when dispatching info.magnolia.types.ContentTypeChangeEvent with info.magnolia.webhooks.registry.ContentTypeEventHandler eventHandler.
      java.lang.NullPointerException: null
      at info.magnolia.webhooks.registry.ContentTypeEventHandler.lambda$findWebhookEventDefinitionsForContentType$0(ContentTypeEventHandler.java:68) ~[magnolia-webhooks-core-2.0.0-SNAPSHOT.jar:?]
      at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:?]
      at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1632) ~[?:?]
      at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) ~[?:?]
      at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) ~[?:?]
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) ~[?:?]
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
      at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:?]
      at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:?]
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
      at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:528) ~[?:?]
      at info.magnolia.webhooks.registry.ContentTypeEventHandler.lambda$findWebhookEventDefinitionsForContentType$1(ContentTypeEventHandler.java:68) ~[magnolia-webhooks-core-2.0.0-SNAPSHOT.jar:?]
      at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176) ~[?:?]
      at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[?:?]
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]

        Acceptance criteria

          There are no Sub-Tasks for this issue.

              rsiska Robert Šiška
              jbenito Javier Benito
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 7h
                  7h