Skip generation of empty or invalid relationships in PlantUML output
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "util/error.h"
|
||||
#include "util/util.h"
|
||||
|
||||
#include <clang-c/CXCompilationDatabase.h>
|
||||
@@ -174,6 +175,13 @@ public:
|
||||
|
||||
void add_relationship(class_relationship &&cr)
|
||||
{
|
||||
if (cr.destination.empty() || type_aliases.count(cr.destination) == 0) {
|
||||
LOG_WARN(
|
||||
"Skipping relationship '{}' - {} - '{}' due to missing alias",
|
||||
cr.destination, to_string(cr.type), usr);
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = std::find(relationships.begin(), relationships.end(), cr);
|
||||
if (it == relationships.end())
|
||||
relationships.emplace_back(std::move(cr));
|
||||
@@ -281,7 +289,8 @@ struct diagram {
|
||||
}
|
||||
}
|
||||
|
||||
return full_name;
|
||||
throw error::uml_alias_missing(
|
||||
fmt::format("Missing alias for {}", full_name));
|
||||
}
|
||||
|
||||
std::string usr_to_name(const std::vector<std::string> &using_namespaces,
|
||||
|
||||
Reference in New Issue
Block a user