
963 P.2d 85 (1998)
154 Or. App. 678
CARE MEDICAL EQUIPMENT, INC., an Oregon corporation, Appellant,
v.
Mark BALDWIN, Respondent, and
Step Saver, Inc., Defendant.
No. CA A95996.
Court of Appeals of Oregon.
Argued and Submitted September 18, 1997.
Decided June 24, 1998.
Joseph D. McDonald, Portland, argued the cause for appellant. With him on the briefs were Laura E. Vaught and Palmer, Feltz, Smith & McDonald.
Charles E. Corrigan, Portland, argued the cause for respondent. With him on the brief were Mark L. Busch and O'Donnell Ramis Crew Corrigan & Bachrach.
Before WARREN, P.J., and EDMONDS and ARMSTRONG, JJ.
ARMSTRONG, Judge.
Plaintiff seeks reversal of the trial court's award of attorney fees to defendant. Plaintiff brought an action against defendant for breach of a noncompetition agreement in defendant's employment contract with plaintiff. The case was tried to a jury, and the jury found that the parties had not entered the noncompetition agreement in conjunction with a bona fide advancement under ORS 653.295[1] of defendant as an employee of plaintiff. Based on that finding, the court ruled that the noncompetition provision was void and unenforceable and dismissed plaintiff's claims. The court subsequently awarded defendant $25,000 in attorney fees against plaintiff in the action. We reverse that award.
Entitlement to attorney fees is a question of law. Selective Services, Inc. v. AAA Liquidating, 126 Or.App. 74, 77, 867 P.2d 545 (1994). As a general rule, a party has no right to recover attorney fees from an opponent unless a statute or contract confers that right. Mattiza v. Foster, 311 Or. 1, 4, 803 P.2d 723 (1990). In this case, the contract provided for attorney fees in the context of the noncompetition agreement, which stated that "it is agreed that violation of this provision shall cause incalculable and irreparable *86 harm to Employer such that the Employer shall be entitled to injunctive relief and the cost of pursuing legal action to enforce this agreement."[2] Plaintiff contends that because defendant successfully established that the noncompetition agreement was void and unenforceable, defendant is not entitled to attorney fees. We agree.
Plaintiff relies on our decision in John Deere Co. v. Epstein, 91 Or.App. 195, 755 P.2d 711 (1988), aff'd. 307 Or. 348, 769 P.2d 766 (1989), and subsequent cases as support for its contention that defendant is not entitled to attorney fees. The underlying premise of those cases is that when a successful action on a contract, or a successful defense to such an action, is based on a claim that the contract was a nullityas in, for example, an action for rescission of the contractthere is no legal basis for an award of attorney fees under the contract, because there is no contract. With no contract or statute to provide for attorney fees, the traditional rule applies and the prevailing party is not entitled to recover attorney fees. See, e.g., Niedermeyer v. Latimer, 307 Or. 473, 769 P.2d 771 (1989); Jitner v. Grant, 96 Or.App. 286, 772 P.2d 450 (1989).
Defendant argues that the John Deere rule does not apply to this case, because the trial court did not rule that the contract as a whole was a nullity but, rather, only that the noncompetition agreement was void. Although we agree that our past decisions have dealt only with actions in which the entire contract was voided or nullified, we see no principled reason why the same logic should not apply to a case such as this one, where the disputed fee provision is of a piece with that portion of the contract that has been voided. Defendant's argument that the attorney-fee clause somehow survives the voiding of the noncompetition agreement fails in light of the fact that the express language of that agreement indicates that the fee provision applies only to actions brought to enforce that agreement. Because the court determined that the noncompetition agreement is void, it follows that the attorney-fee provision is as well.
Reversed.
NOTES
[1]  In defense against plaintiff's action, defendant successfully relied on ORS 653.295, which provides, as relevant:

"(1) A noncompetition agreement entered into between an employer and employee is void and shall not be enforced by any court in this state unless the agreement is entered into upon the:
"(a) Initial employment of the employee with the employer; or
"(b) Subsequent bona fide advancement of the employee with the employer."
[2]  ORS 20.096(1) provides:

"In any action or suit on a contract, where such contract specifically provides that attorney fees and costs incurred to enforce the provisions of the contract shall be awarded to one of the parties, the prevailing party, whether that party is the party specified in the contract or not, at trial or on appeal, shall be entitled to reasonable attorney fees in addition to costs and disbursements."
