while True:
enemy = hero.findNearestEnemy()
# If enemy.type is “munchkin”:
if enemy and enemy.type == "munchkin":
# Then attack it:
hero.attack(enemy)
# If the enemy’s type is “brawler”:
elif enemy.type == "brawler":
# Then say something to call the brawler"
hero.say("I don't think so brawler")
hero.say("I don't think so ogre")
pass
Now it is saying that line 13 cannot read property ‘type’ of null