mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Fix crash for TypeScript enum in substruct (#8430)
See https://github.com/google/flatbuffers/issues/8299.
This commit is contained in:
@@ -901,11 +901,15 @@ class TsGenerator : public BaseGenerator {
|
||||
|
||||
std::string bare_file_path;
|
||||
std::string rel_file_path;
|
||||
const auto &dep_comps = dependent.defined_namespace->components;
|
||||
for (size_t i = 0; i < dep_comps.size(); i++) {
|
||||
rel_file_path += i == 0 ? ".." : (kPathSeparator + std::string(".."));
|
||||
if (dependent.defined_namespace) {
|
||||
const auto &dep_comps = dependent.defined_namespace->components;
|
||||
for (size_t i = 0; i < dep_comps.size(); i++) {
|
||||
rel_file_path += i == 0 ? ".." : (kPathSeparator + std::string(".."));
|
||||
}
|
||||
if (dep_comps.size() == 0) { rel_file_path += "."; }
|
||||
} else {
|
||||
rel_file_path += "..";
|
||||
}
|
||||
if (dep_comps.size() == 0) { rel_file_path += "."; }
|
||||
|
||||
bare_file_path +=
|
||||
kPathSeparator +
|
||||
|
||||
Reference in New Issue
Block a user