0

handle get_worlds() returning None correctly

Exposed by Issue #287:
https://github.com/brownan/Minecraft-Overviewer/issues/287
This commit is contained in:
Aaron Griffith
2011-03-04 23:21:23 -05:00
parent 6a1ee964bf
commit 8b6b5df8ef

View File

@@ -71,6 +71,13 @@ def main():
if not os.path.exists(worlddir): if not os.path.exists(worlddir):
# world given is either world number, or name # world given is either world number, or name
worlds = world.get_worlds() 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: try:
worldnum = int(worlddir) worldnum = int(worlddir)
worlddir = worlds[worldnum]['path'] worlddir = worlds[worldnum]['path']