I've written with some regularity here that attorney's fees generally are not recoverable in a dispute. The primary tool for getting your attorney's fees paid by the other side is a contract term that states you do indeed get your attorney's fees if the other side breaches the agreement.
But, what if the contract you have is deemed void by the court? Do you still get your attorney's fees if you sue for breach of a contract? If worded correctly, the answer is YES.
The key is the contract's wording. Use of the phrase "this clause shall survive the termination of the contract" extracts the attorney fee verbiage from the effects of termination. That a contract is voided is definitively termination. This phrase is also customarily used in non-compete agreements where the confidentiality clause survives beyond the parties' exploration period.
You can have the best of both worlds in a contract. It just needs to be worded correctly. Call me for the correct wording for your situation.