Skip to content

Instantly share code, notes, and snippets.

@jbergstroem
Created September 27, 2010 12:13
Show Gist options
  • Save jbergstroem/598927 to your computer and use it in GitHub Desktop.
Save jbergstroem/598927 to your computer and use it in GitHub Desktop.
diff --git a/world.py b/world.py
index 131cfce..99728c1 100644
--- a/world.py
+++ b/world.py
@@ -299,6 +299,11 @@ def get_worlds():
"Returns {world # : level.dat information}"
ret = {}
save_dir = get_save_dir()
+
+ # No dirs found - most likely not running from inside minecraft-dir
+ if save_dir is None:
+ return None
+
for dir in os.listdir(save_dir):
if dir.startswith("World") and len(dir) == 6:
world_n = int(dir[-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment