Skip to content

Commit 74872fe

Browse files
authored
Merge pull request #1152 from joto/fix-define-table-in-callback
Bugfix: Check that define_table() isn't called in process callback
2 parents 691f016 + 38724ea commit 74872fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/output-flex.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,11 @@ void output_flex_t::setup_flex_table_columns(flex_table_t *table)
706706

707707
int output_flex_t::app_define_table()
708708
{
709+
if (m_context_node || m_context_way || m_context_relation) {
710+
throw std::runtime_error{"Tables have to be defined before calling any "
711+
"of the process callbacks"};
712+
}
713+
709714
luaL_checktype(lua_state(), 1, LUA_TTABLE);
710715

711716
auto &new_table = create_flex_table();

0 commit comments

Comments
 (0)