Uh, in that case the damage was done because the city executed the code. Code by itself can't do anything to you unless you run it. Keeping your systems secure is on you.
Here's another version to better suit your position. Person A drugs you, but person B asks you to go to the ATM, empty it out, and give them all the money. Did person B do anything wrong?
reply
Morally wrong, sure. But legally? Person A committed the crime. One is an act of violence, the other is not.
reply