You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated cmxl version in my project from 0.2.0 to 1.4.1. Then one of my tests parsing a mt940 is failing.
Quickly i found why this happens. Generation_date in statement wants to read from field :20 or :13
In my case i get from my bank (Commerzbank) field :20 only with reference no extra values are provided.
Field :13 is not provided at all because it is mt942.
def generation_date field(20).date || field(13).date end
Call of field(13) gives nil and then method date fails with
NoMethodError: undefined method `date' for nil:NilClass
:20 exists in mt940 and mt942 so even if there is no generation_date provided in that field field(20).date will not fail. It only returns nil. But then field(13).date is called and gives error mentioned above.
Method generation_date should check if field :13 is provided before call date on it.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this.
and without checking the code and the specs this check sounds like a good addition.
Do you want to make a PR for that? that would be amazing!
First of all thanks for sharing the code.
I updated cmxl version in my project from 0.2.0 to 1.4.1. Then one of my tests parsing a mt940 is failing.
Quickly i found why this happens. Generation_date in statement wants to read from field :20 or :13
In my case i get from my bank (Commerzbank) field :20 only with reference no extra values are provided.
Field :13 is not provided at all because it is mt942.
def generation_date field(20).date || field(13).date end
Call of field(13) gives nil and then method date fails with
:20 exists in mt940 and mt942 so even if there is no generation_date provided in that field field(20).date will not fail. It only returns nil. But then field(13).date is called and gives error mentioned above.
Method generation_date should check if field :13 is provided before call date on it.
The text was updated successfully, but these errors were encountered: