PI File adapter additional files error
I'm using file adapter(sender) to read additional files as attachments. I'm picking one XML file as payload and two PDF documents as attachments. One of that PDF document is optional. I have the optional parameter for the second attachment set as 'YES'. When both the files are available the channel picks them up with no error. But when only one file is available it gives an error saying
"Could not process due to error: java.lang.NullPointerException: while trying to invoke the method com.sap.aii.adapter.file.io.FileHandle.length() of an object loaded from an array (which itself was loaded from field com.sap.aii.adapter.file.File2XI.attachedFiles_ of an object) with an index loaded from local variable 'ii'"
The error is thrown in the channel but the files get picked up and processed as usual.
Can anyone help? Not sure why I'm getting this error though I marked the second attachment as optional.
Parameters in the channel:
Source dir ***
Additional files checked
File list attach1,attach2