diff options
-rw-r--r-- | pokemontools/wram.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pokemontools/wram.py b/pokemontools/wram.py index 1029c8e..2133444 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -117,10 +117,10 @@ def read_constants(filepath): """ Load lines from a file and call scrape_constants. """ - lines = None - - with open(filepath, "r") as file_handler: - lines = file_handler.readlines() + lines = [] + if os.path.exists(filepath): + with open(filepath, "r") as file_handler: + lines = file_handler.readlines() constants = scrape_constants(lines) return constants |