At least something good is coming out of that Dunkin’ Donuts flap.

It all started Sunday when a clerk at one of the chain’s shops reportedly turned away two NYPD officers, saying, “I don’t serve cops.” The head of the detectives union declared a boycott until Dunkin’ issues a real apology, while the store manager claimed the officers were standing in the wrong line and corporate went into hiding.

We get that there’s a national anti-cop movement, but the men and women of the NYPD deserve universal respect. They keep driving crime to ever-lower levels, even as Commissioner James O’Neill’s neighborhood-policing initiative and other innovations build ever-deeper dialogue with average citizens.

Despite the NYPD’s good work, it has paid time and again for that national hysteria, most horribly in the assassinations of New York cops. And the paranoia complicates officers’ work every day: It’s not easy making an arrest while a jeering crowd gathers.

So it’s entirely understandable that “I don’t serve cops” would prompt a boycott. But then Tennessee’s Melinda Cox Hall changed the whole story by sending $500 to the New York City Police Foundation and challenging Dunkin’ Donuts to match it.

The company hasn’t, but she inspired others. The foundation has now received thousands of dollars from people all over the country who stand with men and women in blue.

The NYCPF supports counterterrorism work, new crime-fighting tech and programs like Crime Stopper and Gun Stop, which all help make this America’s safest big city.

Wouldn’t it be nice if the NYPD’s critics found a way to turn their anger into something positive?