Fail if no sources are given

This commit is contained in:
Alex Beregszaszi 2017-03-29 15:19:10 +01:00
parent 5aec120da3
commit 2c15e2b541

View File

@ -61,10 +61,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
Json::Value const& sources = _input["sources"]; Json::Value const& sources = _input["sources"];
if (!sources) if (!sources)
{ return formatFatalError("JSONError", "No input sources specified.");
// @TODO report error
return Json::Value();
}
for (auto const& sourceName: sources.getMemberNames()) for (auto const& sourceName: sources.getMemberNames())
m_compilerStack.addSource(sourceName, sources[sourceName]["content"].asString()); m_compilerStack.addSource(sourceName, sources[sourceName]["content"].asString());