witchcraft.lua: check the right condition before trying to edit route.spans