Ensure the language field is present in the JSON

This commit is contained in:
Alex Beregszaszi 2017-04-19 15:53:11 +01:00
parent 6d13260232
commit f71b465eb7

View File

@ -152,6 +152,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
{
m_compilerStack.reset(false);
if (!_input.isObject())
return formatFatalError("JSONError", "Input is not a JSON object.");
if (_input["language"] != "Solidity")
return formatFatalError("JSONError", "Only \"Solidity\" is supported as a language.");
Json::Value const& sources = _input["sources"];
if (!sources)
return formatFatalError("JSONError", "No input sources specified.");