Hi Alex,
Looking at the code, i can say that system throws this error if it is not able to find an address number for the business partner in table BUT020. If you can check and confirm that it is indeed the case, then that may help in further investigation.
regards,
Kul Vaibhav