From 859e58052c3cee6e8e302e2ca06ac1f58d47d1b2 Mon Sep 17 00:00:00 2001 From: Dimitri Diakopoulos Date: Fri, 25 Dec 2015 06:06:40 -0500 Subject: [PATCH] noticed need for additional exception --- src/AudioDecoder.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AudioDecoder.cpp b/src/AudioDecoder.cpp index 5c50a6c..a33173e 100644 --- a/src/AudioDecoder.cpp +++ b/src/AudioDecoder.cpp @@ -118,7 +118,12 @@ std::string NyquistIO::ParsePathForExtension(const std::string & path) const std::shared_ptr NyquistIO::GetDecoderForExtension(const std::string ext) { - return decoderTable[ext]; + if (decoderTable.size()) + { + return decoderTable[ext]; + } + else throw std::runtime_error("No available decoders."); + return nullptr; } void NyquistIO::BuildDecoderTable()