# HG changeset patch # User Neil Muller # Date 1378562000 -7200 # Node ID 49f6adde49d0cc373529aa0db06075b9f666c97b # Parent 0318738e3b848b2ca3367687aa871fb4c29f11ea Protect against corner case crash diff -r 0318738e3b84 -r 49f6adde49d0 tools/area_editor.py --- a/tools/area_editor.py Sat Sep 07 15:42:37 2013 +0200 +++ b/tools/area_editor.py Sat Sep 07 15:53:20 2013 +0200 @@ -152,7 +152,7 @@ pointlist = [self.point_to_pygame(p) for p in polygon] pygame.draw.lines(self._surface, color, False, pointlist, line_width) - if index == mouse_poly and mouse_pos: + if index == mouse_poly and mouse_pos and len(polygon) > 0: endpoint = self.point_to_pymunk(mouse_pos) pygame.draw.line(self._surface, color, self.point_to_pygame(polygon[-1]),