Not to take anything away from New York’s Finest and the rest of the law enforcement community, but the city just dodged what could easily have become a terrorism nightmare.

That dozens of people weren’t killed or injured by a suspected would-be suicide bomber’s homemade explosive is only due to the fact that it was a crude, low-tech pipe bomb.

But it’s yet another reminder that New York remains the No. 1 target of jihadists, organized ones as well as lone wolves like 27-year-old Akayed Ullah.

And, moreover, that New York — especially its transit system — remains vulnerable to such attacks, for all the caution and vigilance of police and civilians.

The Bangladeshi native, reportedly inspired by ISIS, allegedly exploded his “suicide vest” in the crowded tunnel beneath the Port Authority Bus Terminal during Monday morning’s rush hour.

Ullah was seriously wounded, and three others sustained non-life-threatening injuries. His reported motive: avenging violence against Muslims across the world.

This follows October’s truck attack near Ground Zero that claimed eight innocent lives. That one also could’ve been worse: A police officer interrupted it by shooting the perp.

But the cold reality remains that the NYPD faces a brutal challenge in aiming to prevent all terrorist attacks.

Which is why it’s so mystifying that the City Council is moving ahead to pass the Right to Know Act, which would dangerously discourage cops’ ability to perform proactive policing.

A vote is set for next week on this legislation, which is designed to get cops to ignore potential crimes and suspicious behavior for fear of civilian complaints.

But New Yorkers don’t want a police department that merely arrives at the scene of a tragedy to pick up the pieces. They want attacks like Monday’s prevented.

That means not handcuffing the NYPD’s ability to remain constantly vigilant.