SAMD21 Arduino native USB port virus

During modifying and testing variant files, it has happened several times that the bootloader of the SAMD21 stops working and this was irreversible. In fact, I had accidentally created a virus. See here: http://www.avdweb.nl/arduino/samd21/virus.html

Can the Arduino be made invulnerable to this problem?