Fix crash for TypeScript enum in substruct (#8430)
See https://github.com/google/flatbuffers/issues/8299.
This commit is contained in:
parent
8694806f14
commit
99fda81905
|
@ -901,11 +901,15 @@ class TsGenerator : public BaseGenerator {
|
||||||
|
|
||||||
std::string bare_file_path;
|
std::string bare_file_path;
|
||||||
std::string rel_file_path;
|
std::string rel_file_path;
|
||||||
const auto &dep_comps = dependent.defined_namespace->components;
|
if (dependent.defined_namespace) {
|
||||||
for (size_t i = 0; i < dep_comps.size(); i++) {
|
const auto &dep_comps = dependent.defined_namespace->components;
|
||||||
rel_file_path += i == 0 ? ".." : (kPathSeparator + std::string(".."));
|
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 +=
|
bare_file_path +=
|
||||||
kPathSeparator +
|
kPathSeparator +
|
||||||
|
|
Loading…
Reference in New Issue