mirror of
https://github.com/apache/nifi.git
synced 2025-02-09 03:25:04 +00:00
NIFI-5551: If session.get() returns null, then return fron onTrigger instead of assuming that the FlowFile is non-null
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #2964.
This commit is contained in:
parent
8c0705cb6b
commit
6ceee25859
@ -100,6 +100,10 @@ public class UpdateCounter extends AbstractProcessor {
|
||||
@Override
|
||||
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
|
||||
FlowFile flowFile = session.get();
|
||||
if (flowFile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
session.adjustCounter(context.getProperty(COUNTER_NAME).evaluateAttributeExpressions(flowFile).getValue(),
|
||||
Long.parseLong(context.getProperty(DELTA).evaluateAttributeExpressions(flowFile).getValue()),
|
||||
false
|
||||
|
Loading…
x
Reference in New Issue
Block a user