diff --git a/src/Acoustics.Shared/ConfigFile/ConfigFile.Deserialize.cs b/src/Acoustics.Shared/ConfigFile/ConfigFile.Deserialize.cs index a1bb42094..cfad7a644 100644 --- a/src/Acoustics.Shared/ConfigFile/ConfigFile.Deserialize.cs +++ b/src/Acoustics.Shared/ConfigFile/ConfigFile.Deserialize.cs @@ -120,6 +120,11 @@ private static T LoadAndCache(string path, Func factory) (generic, loadedConfig) = Yaml.LoadAndDeserialize(path); } + if (loadedConfig is null) + { + throw new ConfigFileException($"Tried to load the {path} config file but it looks like it was empty. Add some content?", path); + } + // if implements Config in any subtype (more specific than IConfig) if (loadedConfig is Config config) { diff --git a/src/AnalysisPrograms/Recognizers/Base/RecognizerBase.cs b/src/AnalysisPrograms/Recognizers/Base/RecognizerBase.cs index dd54d6412..c2bebe6fc 100644 --- a/src/AnalysisPrograms/Recognizers/Base/RecognizerBase.cs +++ b/src/AnalysisPrograms/Recognizers/Base/RecognizerBase.cs @@ -444,7 +444,7 @@ public RecognizerConfig() }; } - public string HighResolutionIndicesConfig { get; set; } + public string HighResolutionIndicesConfig { get; set; } = "Towsey.Acoustic.HiResIndicesForRecognisers.yml"; public AcousticIndices.AcousticIndicesConfig HighResolutionIndices { get; private set; } }