[
https://issues.apache.org/jira/browse/NIFI-3127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15780611#comment-15780611
]
ASF GitHub Bot commented on NIFI-3127:
--------------------------------------
Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1358#discussion_r93941409
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java
---
@@ -288,7 +290,7 @@ public void process(InputStream in) throws IOException {
int fragmentIndex = 1; // set to 1 to preserve the existing
behavior *only*. Perhaps should be deprecated to follow the 0,1,2... scheme
String fragmentId = UUID.randomUUID().toString();
- if (computedSplitsInfo.size() == 0) {
+ if ((computedSplitsInfo.size() == 0) && (headerFlowFile != null)) {
--- End diff --
I assume the original author had a reason, the description of the processor
says "If after computation of the header there are no more data, the resulting
split will consists of only header lines."
> NullPointerException in SplitText on empty files
> ------------------------------------------------
>
> Key: NIFI-3127
> URL: https://issues.apache.org/jira/browse/NIFI-3127
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.1.0, 1.1.1
> Reporter: Joseph Gresock
> Assignee: Joseph Gresock
> Fix For: 1.2.0
>
>
> This can be reproduced by routing an empty file to SplitText and setting the
> line split count to 1.
> 2016-11-30 13:00:01,133 ERROR [Timer-Driven Process Thread-62]
> o.a.nifi.processors.standard.SplitText
> SplitText[id=7ef1aa84-233c-31d6-b34d-b169660f5284]
> SplitText[id=7ef1aa84-233c-31d6-b34d-b169660f5284] failed to process due to
> java.lang.NullPointerException; rolling back session:
> java.lang.NullPointerException
> 2016-11-30 13:00:01,133 ERROR [Timer-Driven Process Thread-62]
> o.a.nifi.processors.standard.SplitText
> java.lang.NullPointerException: null
> at
> org.apache.nifi.processors.standard.SplitText.generateSplitFlowFiles(SplitText.java:292)
> ~[nifi-standard-processors-1.1.0.jar:1.1.0]
> at
> org.apache.nifi.processors.standard.SplitText.onTrigger(SplitText.java:253)
> ~[nifi-standard-processors-1.1.0.jar:1.1.0]
> at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
> ~[nifi-api-1.1.0.jar:1.1.0]
> at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1099)
> [nifi-framework-core-1.1.0.jar:1.1.0]
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
> [nifi-framework-core-1.1.0.jar:1.1.0]
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
> [nifi-framework-core-1.1.0.jar:1.1.0]
> at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
> [nifi-framework-core-1.1.0.jar:1.1.0]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> [na:1.8.0_111]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)