The lawyer usually doesn't check that. Usually the lawyer recommends the buyer to purchase "title insurance" at the cost of ~$25. With the title isurance, the insurance company will pay any debt on the house happended before the closing date.
According to the practice, if you didn't buy title insurance, you may have to pay that.