summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rojewski <kamil.rojewski@gmail.com>2021-02-25 23:57:10 +0100
committerGitHub <noreply@github.com>2021-02-25 14:57:10 -0800
commitbf90612007f2163857eaefd5ab1989a9fd7fc253 (patch)
tree44a4fa16d67878c32f3dcb832dc90d5b3d4ad86f
parent8142fedd196e20d24c48485396821b12034e7eb9 (diff)
downloadflatbuffers-bf90612007f2163857eaefd5ab1989a9fd7fc253.tar.gz
flatbuffers-bf90612007f2163857eaefd5ab1989a9fd7fc253.tar.bz2
flatbuffers-bf90612007f2163857eaefd5ab1989a9fd7fc253.zip
fix for noUncheckedIndexedAccess in ts (#6474)
-rw-r--r--.gitignore1
-rw-r--r--src/idl_gen_ts.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 2a9f92c3..8c7740ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -143,3 +143,4 @@ yarn-error.log
**/dist
**/vendor
**/go.sum
+/tests/**/*.js
diff --git a/src/idl_gen_ts.cpp b/src/idl_gen_ts.cpp
index 915b05e4..2ebf1f7f 100644
--- a/src/idl_gen_ts.cpp
+++ b/src/idl_gen_ts.cpp
@@ -1460,7 +1460,7 @@ class TsGenerator : public BaseGenerator {
code += " for (let i = data.length - 1; i >= 0; i--) {\n";
code += " builder.add" + GenWriteMethod(vector_type) + "(";
if (vector_type.base_type == BASE_TYPE_BOOL) { code += "+"; }
- code += "data[i]);\n";
+ code += "data[i]!);\n";
code += " }\n";
code += " return builder.endVector();\n";
code += "}\n\n";