Never take out a cash advance before filing bankruptcy. Likewise, you cannot take out a cash advance to pay your bankruptcy attorney! While the applicable dollar values recently changed, this article is a good reminder of one of the many things you should not do before filing bankruptcy.
In general, the law disfavors debtors who incur debt on the eve of bankruptcy. Accordingly, a section of the bankruptcy code establishes a presumption of nondischargeability if a cash advance over a certain amount is taken within 70 days before filing bankruptcy.
The best thing you can do is to speak with a bankruptcy attorney as soon as you think about bankruptcy. Since consultations are usually free there is no downside to seeking legal counsel. More to the point, seeking bankruptcy counsel early on can stop you from taking an action that disadvantages your bankruptcy.