Fixed regression on ID parameter parsing

This commit is contained in:
emeric
2021-09-23 13:21:24 +02:00
parent 2ebc4280a0
commit 5aa0e835cd
2 changed files with 2 additions and 15 deletions
+2 -4
View File
@@ -40,10 +40,8 @@ namespace API::Subsonic
for (const std::string& param : it->second)
{
auto value {StringUtils::readAs<T>(param)};
if (!value)
throw BadParameterFormatGenericError {paramName};
res.emplace_back(std::move(*value));
if (value)
res.emplace_back(std::move(*value));
}
return res;
@@ -178,17 +178,6 @@ class BadParameterGenericError : public GenericError
const std::string _parameterName;
};
class BadParameterFormatGenericError : public GenericError
{
public:
BadParameterFormatGenericError(const std::string& parameterName) : _parameterName {parameterName} {}
private:
std::string getMessage() const override { return "Parameter '" + _parameterName + "': bad format"; }
const std::string _parameterName;
};
class Response
{
public: