aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/ast/AST.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp
index 480fce44..562ac828 100644
--- a/libsolidity/ast/AST.cpp
+++ b/libsolidity/ast/AST.cpp
@@ -192,7 +192,8 @@ void ContractDefinition::setUserDocumentation(Json::Value const& _userDocumentat
std::string ContractDefinition::fullyQualifiedName() const
{
- std::string qualifiedName = *(location().sourceName) + ":" + name();
+ std::string sourceString = *(location().sourceName);
+ std::string qualifiedName = (sourceString.empty() ? ("") : (sourceString + ":")) + name();
return qualifiedName;
}