handle get_worlds() returning None correctly
Exposed by Issue #287: https://github.com/brownan/Minecraft-Overviewer/issues/287
This commit is contained in:
7
gmap.py
7
gmap.py
@@ -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']
|
||||||
|
|||||||
Reference in New Issue
Block a user