don't crash when config file is empty

This commit is contained in:
Adrian Sampson 2013-02-21 11:03:22 -08:00
parent 6c1b49aadb
commit d3a00ec443
2 changed files with 3 additions and 1 deletions

View file

@ -633,7 +633,7 @@ class Configuration(RootView):
for appdir in self._search_dirs():
filename = os.path.join(appdir, CONFIG_FILENAME)
if os.path.isfile(filename):
yield ConfigSource(load_yaml(filename), filename)
yield ConfigSource(load_yaml(filename) or {}, filename)
def _default_source(self):
"""Return the default-value source for this program or `None` if

View file

@ -8,6 +8,8 @@ Changelog
exiting with an exception. We also avoid an error when track metadata
contains newlines.
* Fix a crash when iTunes Sound Check tags contained invalid data.
* Fix an error when the configuration file (``config.yaml``) is completely
empty.
1.1b2 (February 16, 2013)
-------------------------