[MGNLHOOK-210] NPE when processing info.magnolia.types.ContentTypeChangeEvent events Created: 06/Sep/22  Updated: 17/Nov/22  Resolved: 31/Oct/22

Status: Closed
Project: Magnolia Webhooks
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.1

Type: Bug Priority: Neutral
Reporter: Javier Benito Assignee: Robert Šiška
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 7h Time Spent: 3h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLHOOK-267 NullPointerException when empty events Backlog
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLHOOK-251 Implementation Sub-task Completed Robert Šiška  
MGNLHOOK-252 Review Sub-task Completed Oanh Thai Hoang  
MGNLHOOK-253 Pre-Integration QA Sub-task Completed Oanh Thai Hoang  
MGNLHOOK-254 QA Sub-task Completed Phong Le Quoc  
Team: DeveloperX
Date of First Response:
Epic Link: Webhooks Maintenance (Phase 1)
Sprint: DevX 22
Story Points: 2

 Description   

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) ~[?:?]



 Comments   
Comment by Phong Le Quoc [ 28/Oct/22 ]

A follow ticket https://jira.magnolia-cms.com/browse/MGNLHOOK-267

Generated at Mon Feb 12 10:02:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.