diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-08-06 19:56:28 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-11-14 18:29:16 +0800 |
commit | 5778af07a390f70692be927f3e9702f1725d78f4 (patch) | |
tree | afb374568ab65eff16ef4cf1661b0ed08e6485ac | |
parent | 17e81c6ecabe3be8f0553e13ab93393d7315a4d0 (diff) | |
download | dexon-solidity-5778af07a390f70692be927f3e9702f1725d78f4.tar.gz dexon-solidity-5778af07a390f70692be927f3e9702f1725d78f4.tar.zst dexon-solidity-5778af07a390f70692be927f3e9702f1725d78f4.zip |
Do not crash on filesystemFriendlyName if no contracts were compiled
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 441c7897..889903f0 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -389,6 +389,9 @@ string const* CompilerStack::runtimeSourceMapping(string const& _contractName) c std::string const CompilerStack::filesystemFriendlyName(string const& _contractName) const { + if (m_contracts.empty()) + BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("No compiled contracts found.")); + // Look up the contract (by its fully-qualified name) Contract const& matchContract = m_contracts.at(_contractName); // Check to see if it could collide on name |