From 8b6b5df8ef9a0b15718ca9415dec35eaea456e43 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Fri, 4 Mar 2011 23:21:23 -0500 Subject: [PATCH] handle get_worlds() returning None correctly Exposed by Issue #287: https://github.com/brownan/Minecraft-Overviewer/issues/287 --- gmap.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gmap.py b/gmap.py index 11f29ee..b5bd213 100755 --- a/gmap.py +++ b/gmap.py @@ -71,6 +71,13 @@ def main(): if not os.path.exists(worlddir): # world given is either world number, or name worlds = world.get_worlds() + + # if there are no worlds found at all, exit now + if not worlds: + print "Invalid world path" + parser.print_help() + sys.exit(1) + try: worldnum = int(worlddir) worlddir = worlds[worldnum]['path']