In any action upon a note, bond, bill, or other instrument in writing, for the payment of money or property, or the performance of covenants or conditions, if such instrument was made or entered into without a good and valuable consideration, or, if the consideration upon which it was made or entered into has wholly or in part failed, it shall be lawful for the defendant to plead such want of consideration, or that the consideration has wholly or in part failed; and if it shall appear that such instrument was made or entered into without a good or valuable consideration, or that the consideration has wholly failed, judgment shall be rendered in favor of the defendant; and if it shall appear that the consideration has failed in part, the plaintiff shall recover according to the justice of the case: Provided, that nothing in this section contained shall be construed to affect or impair the right of any bona fide assignee of any instrument made assignable by this act, when such assignment was made before such instrument became due.
815 ILCS 105/9