As Election Day approached, some general counsel found that trying to control heated debates and hostile campaigning behavior in the workplace can raise numerous legal issues.

That is especially true in a presidential race that features African-American and Mormon candidates alongside hot-button issues on gay rights, women’s health, immigration, and more.

When it comes to politics in the workplace, “discrimination is the No. 1 danger,” said Dana Howells, a senior labor and employment lawyer at Seyfarth Shaw in Los Angeles. “Politics tends to get intertwined with ethnic, racial, age, religious and gender issues, with many differences of opinion.”

Howells said employers have to be careful not to create “an implication of discrimination” through statements made by managers and supervisors who think they are simply discussing politics.

Companies don’t want to tell employees they can’t talk about politics at all. But there are legal complications, such as “hostile environment” claims made by a person in the same category as a candidate—e.g., an employee who happens to be African-American or gay and is being maligned.

Professor Martin Malin, director of the Institute for Law and the Workplace at the Chicago-Kent College of Law, said another area of concern is employers who want to tell their employees how to vote. He cited news reports of one CEO who sent out letters to employees implying that if a particular candidate wins, the company could go out of business.

Most states have laws against intimidating voters, Malin said, “so before I sent a letter like that, I’d check first with my general counsel.”

He also pointed out that nonprofit entities, including some universities and most churches, endanger their tax-exempt status if they allow politics into the workplace.

At corporations, Malin suggested, employers should treat political debates the same as they would treat, say, a debate over the Chicago Bears versus the Green Bay Packers. “If it comes to blows or disrupts the workplace, then the employees deserve to be disciplined,” he said.

Companies can help themselves avoid legal trouble by having clear policies on what will be tolerated, said Sonya Rosenberg, an employment attorney with Neal, Gerber & Eisenberg in Chicago, agreed.

The key, she added, is well-trained managers who can act quickly. “If employees are getting into heated exchanges that may upset a person of a certain race, gender, religion or sexual orientation, the manager needs to recognize it and not ignore it.”

Rosenberg said the response should be “thoughtful and appropriate.”

So if two employees are discussing politics in a respectful way, Rosenberg notes, “there is nothing wrong with that. But is management getting involved, and is a manager expressing opposite political views to the employee? That could become an issue later if the employee receives an evaluation that she thinks is lower than it should be.”

Howells, in California, said controversial ballot issues, such as on immigration or gay marriage, “tend to bring out the tension and differences in the workplace.”

In fact, Howells said the first employee lawsuit in California over sexual orientation came about because of a state statute protecting employees’ political affiliations.

“A law firm told its employees not to talk to clients about their pro-gay-rights views. And one employee sued, saying the policy violated the labor code section that protects employees from coercion based on political activities.” The employee won.

Howells said compliance with state laws is another area that general counsel should watch closely during election season. Specific rights, obligations and protections vary from state to state, she said, such as paid time off to vote.

She cited a new California law that limits an employer’s right to regulate dress in the workplace related to religion. So what if an employee wears an “Elect a Mormon for President” T-shirt or a “Mormons for Romney” campaign button?

Howells isn’t sure. “It’s a new law with no cases on the books. But I’d argue that a political button isn’t part of religious observance.”

And union employees are protected when they engage in union-related speech, Malin, the law professor, warned. For example, he suggested union workers could hand out leaflets favoring candidates who support the Affordable Care Act because workplace health insurance is a legitimate union concern.

“But just handing out leaflets endorsing specific candidates is a much grayer area, and it might depend on how the endorsement is worded,” he added.

Howells agreed with Rosenberg that carefully crafted company policies are key, including on politicking. She said she is seeing many challenges to personnel policies or employee handbook provisions for being overbroad.

“I’ve been practicing employment law a long time,” Howells said, “and I have never seen such an upsurge in enforcement activity directed at employer policies.”

The biggest push is on the national level, she explained, with the National Labor Relations Board invalidating employer policies that “chill” employees’ rights. One invalidated policy simply required employees to treat others with courtesy in the workplace.

But Howells said the No. 1 phone call she gets from companies is about poster obligations. Again, different states have different requirements, such as California demanding that employers post notices about employees getting time off to vote.

“But this is an easy answer. Most poster sets that employers can buy have both the federal and state notices in them,” Howells said. “I like when I can make it easy on a client.”