If they are fruitflies, there is a good chance that you'll make apple cider vinegar. If they aren't, just some other kind of bugs, you might be ok. I'm a squeamish person, so seeing insects would freak me out and I'd throw it out.
Broken Leg Brewery
Giving beer a leg to stand on since 2006