You spent your single days building a good credit rating, paying off your debts and saving a nice chunk of change. Your partner? Not so much. In fact, your future spouse has quite a bit of debt.

Marriage is about making it work for better or worse, but it doesn’t seem fair that exchanging vows could unravel all your hard work. Fortunately, it doesn’t have to. Here’s what you should know about protecting your finances when marrying someone with debt.

How getting married affects your credit

When two people get married, they combine many areas of their lives. The two of you may share the same home, bank accounts, perhaps even last name. So how does getting married affect your credit?

Even so, it is possible for your spouse to impact your credit (and vice versa) once you’re married.

“If you incur joint debts with your spouse, those will appear on your credit report,” Pollock explained. “If there are late or delinquent payments for those accounts, that can impact your credit.” So if you share a mortgage and your spouse forgets to make the payment one month, both your scores could take a hit.

Pollock also raised the situation in which the two of you decide to apply jointly for a loan. If your spouse has poor credit ― even if yours is good ― that could force you as a couple to pay a higher interest rate or not qualify at all.

Similar to your credit, any debt that you or your spouse incurred before tying the knot will remain that individual’s responsibility. “Premarital debt of a party will not become joint debt,” said Pollock. However, once you’re married, things work differently.

Any debt that you incur jointly as a couple will be yours to share ’til death do you part. Depending on where you live, any debt your spouse racks up on their own, even if it’s without your knowledge, could also become equally your responsibility.

The issue is whether you live in a community property state or a common law state.

In addition, Norris said, “In about half of the common law states, a creditor cannot go after certain joint property to pay the separate debts of one spouse.” She advised couples in those states to consider titling their ownership of joint assets as “tenants by the entirety” for greater protection.

However, according to Pollock, debt that is in just one person’s name in a common law state could still be considered the responsibility of both spouses “if the debt is related to what are considered marital expenses.” (Those include rent or mortgage payments, utilities, groceries and childcare.) Though creditors can’t try to collect from the spouse who didn’t incur the debt, missed payments can still harm both spouses’ credit.

In community property states, all debt that is incurred during the marriage is considered the responsibility of both parties, regardless of whose name it’s in or what the funds were used for.

Community property states include Alaska (if both parties agree to set up their finances that way), Arizona, California, Idaho, Louisiana, Nevada, New Mexico, Texas, Washington and Wisconsin.

Finally, keep in mind that if you use your own money to help your spouse repay the debt they brought into the marriage, don’t expect to get those funds back in the event of a divorce, regardless of where you live.

What to do to protect yourself

As with anything in marriage, success in handling your finances starts with a strong foundation of communication. It’s important to talk about money regularly and be open and honest with each other.

Of course, we know that not everyone is honest and not all marriages are successful. So it doesn’t hurt to take a few precautions.

First, you can protect your credit and assets by not adding your name to your partner’s debt, “even if you view yourself as a financial team,” said Norris. You might want to help pay off those debts if the two of you decide that’s what’s best for your family. But on paper, the debt should belong to your spouse alone.

Similar considerations apply to debts you take on during the marriage. If your spouse’s debt could have impacted their credit negatively, you might want to think about putting credit cards or loans in your name only to qualify for better terms and interest rates. The trade-off here is that you can’t include your partner’s income on the application, so you might qualify to borrow less.

Finally, if you live in a community property state, you may want to take extra measures to ensure your assets are protected. Though it’s often a sensitive subject to bring up, a prenuptial agreement can do just that.

“Executing a prenuptial agreement can help to define how responsibility for different kinds of debts can be allocated, including the repayment of debts that a party incurred before the marriage,” said Pollock.

Without a prenup in place, much of your financial situation is left open to interpretation. “Meeting with counsel to discuss how a prenuptial agreement can alleviate those concerns is a good idea,” Pollock said.

The good news is that your intended’s premarital debt doesn’t have to be a deal breaker. It might impact your household budget and your lifestyle as a married couple, and you should find out how much they owe well before the wedding. But legally, that debt doesn’t become yours just because you got married.

What’s usually more important is to pay attention to how your spouse handles their finances. Maybe they pursued an expensive degree or lost a job. In that case, it makes sense that they’d have some debt to pay off. But if the debt is a result of overspending or negligent behavior, you should recognize there’s a good chance that behavior isn’t going to change once they say “I do.”

There are steps you can take to protect your own assets, but at the end of the day, you should be able to trust your spouse to be honest about their financial situation and to make smart decisions that benefit you both. Otherwise, why get married at all?