From d3a00ec4439fdb38ce36451211ad78c0c7eeb656 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 21 Feb 2013 11:03:22 -0800 Subject: [PATCH] don't crash when config file is empty --- beets/util/confit.py | 2 +- docs/changelog.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/beets/util/confit.py b/beets/util/confit.py index 7af3bf733..43469b162 100644 --- a/beets/util/confit.py +++ b/beets/util/confit.py @@ -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 diff --git a/docs/changelog.rst b/docs/changelog.rst index 720c5d54c..1d412023e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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) -------------------------