FTR, I was the one who made the big morality statements, not SD_R.
You have a lease. I highly doubt that lender is going to try to void your lease. If after they foreclose they approach you or you approach them with your accrued rents I wouldn’t be at all surprised if they declined to accept them anyway. In fact, they might even be open to continuing your lease for a while at the same or even at reduced rates just to have someone there maintaining the place until they can get it together enough to sell it.
I think there’s still some room in here for everyone (save your landlord) to come out ahead without it being at anyone’s expense.