Donald Trump at a recent rally. (Evan Vucci/AP)

Whatever you think of FBI director James B. Comey’s letters to Congress regarding Hillary Clinton’s emails, the episode and accompanying anonymous FBI leaks underscored something important about America’s law enforcement community: its widespread support for Donald Trump. Such support is hardly confined to the FBI. Many police unions have endorsed the Republican presidential nominee, including the National Immigration and Customs Enforcement Council and the 330,000-member Fraternal Order of Police.

It’s troubling that any reputable group would support Trump. It is particularly damaging for police unions to do so, because these endorsements are both a gratuitous insult and a huge lost opportunity, making it harder for officers to reach out to minority communities that Trump has offended during this election season.

The lost opportunities are particularly obvious here in Chicago, where crime is up and police-community relations are strained. The statements of police union leaders are one of many flash points in the wake of tragic police shootings and the national controversies that arose after the death of Michael Brown, in Ferguson, Mo. Earlier this year, I served on one working group concerned with policing reform in the wake of the Laquan McDonald shooting. As part of that work, I attended various public meetings where activists and community residents lambasted specific collective-bargaining provisions they believe excessively shield bad police officers.

Both police officers and minority community residents have reason to feel embattled and aggrieved. In this angry and difficult time, the FOP undercut its own members by endorsing the most divisive presidential candidate of our lifetime. David Fisher, president of the greater Philadelphia chapter of the National Black Police Association, expressed the views of many. “At a time when we’re all trying to unite and bring the world to a calm,” he said, “the last person we need is a Donald Trump. And the last thing the police need is to hitch its wagon to a Donald Trump.”

I recently spoke with Charles P. Wilson, national chairman of the National Association of Black Law Enforcement Officers. (Wilson is not a member of the FOP.) I asked whether this endorsement would harm the reputation of police in minority communities. Wilson responded with a laugh: “You think so?”

“The vast number of black and Latino officers would not support Donald Trump under any circumstances,” he said. “The endorsement shows a lack of understanding, a lack of consideration for the many black and Latino officers who are members of that organization.”

Imagine, for example, that you are a police officer patrolling Chicago’s Englewood community. Like many officers, you are hoping to elicit the community’s cooperation to address the surge in gun and gang violence that has made 2016 such a tough year. Englewood is 96.6 percent African American. And now you labor under the additional burden that your national union endorsed a presidential candidate who brazenly and falsely challenged the citizenship of Chicago’s own Barack Obama, the most revered African American politician in our nation’s history.

Or suppose that you are patrolling a few miles northwest, in Chicago’s Little Village, where almost half the residents are foreign-born, principally from Mexico. You’re trying to convince immigrant families to provide tips on local crime and gang violence. Now you labor under the additional burden that your national union endorsed a man whose very campaign announcement denounced illegal immigrants from Mexico as rapists and criminals, and whose attacks on an Indiana judge of Mexican heritage were described by his own most prominent political ally as “the textbook definition of a racist comment.”

Or imagine you’re an officer in Chicago’s southwest suburbs, where you’re working with local Muslim residents in case some youth becomes radicalized by a militant group. Now you labor under the additional burden that your national union has endorsed Donald Trump, a man who has called for a temporary ban on the entry of Muslims into the United States and has repeatedly insulted the parents of an American Muslim war hero.

Or imagine you’re an officer trying to convince women who are victims of sexual assault at home or at work to come forward to report these crimes. You’re trying to reassure these women that your department will humanely support them. And now you labor under the additional burden that your national union has endorsed a man who boasts of some of the very predatory behaviors you are hoping women will report.

Finally, imagine that you are a recruiter or human resource officer for any big-city department. You’re trying to recruit minority and female officers to create a more diverse force. You’re trying to convince these men and women that modern policing doesn’t match the stereotypes they may hold, that your department is forging a new relationship with the communities that most need effective policing. That’s never easy. Now you labor under the additional burden that your national union has endorsed a man who has deeply offended these very communities, and has spoken out in support of precisely the heavy-handed tactics that most offend young men and women you hope to recruit.

The police cannot prevent or solve crimes without the support of the communities in which they work. Public safety is always the joint product of law enforcement and these communities. For this partnership to work, communities must back police. Police must back these communities, too, earning a sense of trust and legitimacy that must never be taken for granted.

Wilson and other minority officers recognize the challenges police face every day. When communities do not support police, it’s easy to see why officers might become cynical, passive and reactive, responding to 911 calls but otherwise keeping their heads down without truly engaging the communities they serve.

Minority officers may also see with greater clarity why so many communities feel so distant from police, why good people on each side of a human divide must reach out, and — at minimum — avoid inflicting gratuitous offense. That applies to angry Black Lives Matter activists who are tempted to demonize police. It applies to angry police union officials, too, who are tempted to resist or resent calls for long-overdue reforms.

Imagine the public reaction had the FOP issued a simple statement that said: “Many of our members frankly disagree with Hillary Clinton on policy. But our organization cannot endorse a candidate who offends so many of the people we are sworn to protect and serve.” Many minority communities, many minority law enforcement professionals, too, would have taken solace from that. That wouldn’t have been so hard. In 2012, the FOP declined to endorse Mitt Romney or Barack Obama.

Instead, this time around, the FOP and some other police organizations committed an unforced error. They went out of their way to embrace a candidate who specifically insults or offends nearly every community that police are now struggling to engage. In so doing, police unions damaged their own legitimacy in a way that no cellphone video of a rogue officer, no angry protester, ever could.