mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Minor improvement: check sources
- returns error, if "sources" is an array, an empty object or not defined - Added new test-cases in test/libsolidity/StandardCompiler.cpp
This commit is contained in:
@@ -236,7 +236,11 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
||||
return formatFatalError("JSONError", "Only \"Solidity\" is supported as a language.");
|
||||
|
||||
Json::Value const& sources = _input["sources"];
|
||||
if (!sources)
|
||||
|
||||
if (!sources.isObject() && !sources.isNull())
|
||||
return formatFatalError("JSONError", "\"sources\" is not a JSON object.");
|
||||
|
||||
if (sources.empty())
|
||||
return formatFatalError("JSONError", "No input sources specified.");
|
||||
|
||||
Json::Value errors = Json::arrayValue;
|
||||
|
||||
Reference in New Issue
Block a user