csingley / ofxtools

Python OFX Library
Other
301 stars 68 forks source link

empty text fields not handled properly in convert() #188

Open isaacnorman82 opened 2 months ago

isaacnorman82 commented 2 months ago

I have an ofx file with a STMTTRN that has an empty MEMO.

During the convert() operation I was getting an error because MEMO was not found in the models attributes.

I believe this is because the code is incorrectly treating an empty text node as a node that needs to be recursed into.

I was able to resolve the issue by changing the check 'elif elem.text' inside base.py update_args() to be 'elif elem.text or len(elem) == 0'. Basically if there are no children to recurse into treat it as text. Not sure if this is 100% correct but the code here is a bit hard to read.