In the space of two weeks, seven police officers — four in Oakland and then three in Pittsburgh this past Saturday — were shot and killed in the line of duty. In between those incidents, the Massachusetts Supreme Judicial Court issued a ruling that seriously hampers the right of police in this state to determine whether a suspect is armed.

The SJC ruling, which resulted in the dismissal of all charges against a man caught in the act of dealing crack cocaine in Boston's Theater District back in December 2005, is an abomination. It put the rights of suspected criminals ahead of the public's interest in keeping their streets safe and police officers' right to protect themselves.

The decision flies in the face of common sense. An officer spotted a man who was a known drug dealer talking quietly with another man on a darkened street corner. As the officer approached, the man swallowed something — obviously the drug he had in his hand. As the officer patted him down, five packets of crack cocaine fell out of his pants leg. He was arrested, and when brought to the station, police found 45 more packets tucked into the roll of his belly fat.

Sure sounds like a drug dealer. That officer deserves a thumbs-up for being observant and decisive.

But the majority of the court argued the officer had no right to pat down the man. Forget about the fact that he had a police record, was observed swallowing an illegal drug and was in an area where violent crime is a problem. The way the court viewed the circumstances, he may as well have been sitting on a sunny lawn at the Esplanade with his doting grandmother, sipping iced tea.

Justice Judith Corwin, the lone dissenting vote, got it exactly right when she declared, "The court's decision ignores reality."

It's easy for Corwin's colleagues to take the position they did. They're not apt to confront someone who's up to no good in a dark alley in the middle of the night.

According to the majority opinion issued last week, unless that person "made particular gestures or used any body language that would cause the officers to believe that he was carrying a weapon," police would not be empowered to pat the suspect down to determine whether he or she was armed.

There are well over 200 million guns in private hands in the United States, and they remain relatively easy to obtain by legal means or otherwise. (In a 1997 survey, a quarter of Los Angeles high school students said they could get their hands on a firearm for less than $50.)

As Justice Corwin correctly noted in her dissent, "It is unreasonable to subject law enforcement officers to the risk of attack in the present circumstances."

We'd urge police officers to continue doing what they need to in order to keep themselves safe and return to their families unharmed at the end of their shifts. And perhaps by the time another case involving an allegedly illegal pat-down search makes it to the high court, the justices will have seen the error of this latest decision.