Lawsuits against HOA's are becoming more common, at least in my neck of the woods. It's not unusual to find one against an HOA while you are in escrow. The lender will consider the amount of the judgment against the funds the HOA is in possession of, and will assess their risk. If the suit is minor and the HOA is well funded, it most likely will not affect your close of escrow. If the judgment is large and will deplete the HOA funds to a dangerous level, the lender will likely refuse to fund until there is resolution at which time the lender can reconsider.
If this is the case this would not be a smart purchase anyway. When HOA's are poorly funded there is not enough money to cover necessary repairs and upgrades which would cause an assessment or a series of them. Assessments often throw condo owners over the edge of what they can afford to pay monthly and can prove to be disastrous for some.