Handle absence of Natspec doc and add option to solc

This commit is contained in:
Lefteris Karapetsas 2014-12-02 11:03:34 +01:00
parent e411449219
commit 0d3ab07ad1

View File

@ -140,8 +140,12 @@ string const& CompilerStack::getDocumentation()
for (FunctionDefinition const* f: exportedFunctions) for (FunctionDefinition const* f: exportedFunctions)
{ {
Json::Value user; Json::Value user;
user["user"] = Json::Value(*f->getDocumentation()); auto strPtr = f->getDocumentation();
methods[f->getName()] = user; if (strPtr)
{
user["user"] = Json::Value(*strPtr);
methods[f->getName()] = user;
}
} }
doc["methods"] = methods; doc["methods"] = methods;
m_documentation = writer.write(doc); m_documentation = writer.write(doc);