File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -658,9 +658,6 @@ class LuaBfbsGenerator : public BaseBfbsGenerator {
658658 void EmitCodeBlock (const std::string& code_block, const std::string& name,
659659 const std::string& ns,
660660 const std::string& declaring_file) const {
661- const std::string root_type = schema_->root_table ()->name ()->str ();
662- const std::string root_file =
663- schema_->root_table ()->declaration_file ()->str ();
664661 const std::string full_qualified_name = ns.empty () ? name : ns + " ." + name;
665662
666663 std::string code = " --[[ " + full_qualified_name + " \n\n " ;
@@ -672,7 +669,15 @@ class LuaBfbsGenerator : public BaseBfbsGenerator {
672669 code += " flatc version: " + flatc_version_ + " \n " ;
673670 code += " \n " ;
674671 code += " Declared by : " + declaring_file + " \n " ;
675- code += " Rooting type : " + root_type + " (" + root_file + " )\n " ;
672+
673+ const r::Object* root_table = schema_->root_table ();
674+ if (root_table) {
675+ const std::string root_type = root_table->name ()->str ();
676+ const std::string root_file = root_table->declaration_file ()->str ();
677+
678+ code += " Rooting type : " + root_type + " (" + root_file + " )\n " ;
679+ }
680+
676681 code += " \n --]]\n\n " ;
677682
678683 if (!requires_.empty ()) {
You can’t perform that action at this time.
0 commit comments