Kithgard Brawl, first round help

Figured i would start my character off easy, a simple attack until he died, and i could figure out where to improve my code fromthere, but every time in the game he stops attacking at around 15 seconds. it’s ticking me off, and some part of me thought maybe the potion spawning in the game would be causing it, but my character does still fight new enemies spawned for about 3 seconds after potion spawns.
<while True:
enemy = hero.findNearestEnemy()

it gives me an error of

<Attacks argument enemy has a problem. is there an enemy in your line of sight?>

Please format your code according to the FAQ.

I think you need an if enemy: before hero.attack(enemy)