Accidentally outputting to an optoisolator
Putting a 220ohm-1kohm resistor between the pin and the transistor will keep any output current to a reasonable limit while still keeping the input signal within an acceptable envelope.