Recently I was in court for an eviction. As I was waiting for my case to be called at a case before my case, landlord brought 3 tenants/occupants to court for non payment/eviction. The judge asked the tenants did they owe this money, 2 of the 3 defendants said yes, the 3rd said no. The 2 who said yes, were in the process of filing bankruptcy. The judge advised the landlord that since they were under bankruptcy protection it's not much authority he has to evict. The 3rd who said no, was given another date to return for trial.
The landlord was advised to go to the bankruptcy court for information what would be the necessary steps the landlord needs to follow to evict the tenant. So I don't think there is much a landlord can do to prevent/protect themselves once the tenant has filed for bankruptcy.
Here is link to some information I found online :
http://realestate.findlaw.com/landlord-tenant-law/how-a-tenant-bankruptcy-affects-a-landlord-s-right-to-evict.html