What happens to a person’s mortgage when the lending company goes bankrupt?

Garry C asked: Does the person pay the mortgage balance to the bankruptcy court? Does the person have to find another lending company to take up the mortgage balance?