Skip to content

Commit 4e86887

Browse files
committed
A better place for checking for missing outputs
1 parent 835b092 commit 4e86887

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/osmdata.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ osmdata_t::osmdata_t(std::shared_ptr<middle_t> mid,
2222
: m_mid(mid), m_outs(outs)
2323
{
2424
assert(m_mid);
25-
26-
if (m_outs.empty()) {
27-
throw std::runtime_error{"Must have at least one output, "
28-
"but none have been configured."};
29-
}
25+
assert(!m_outs.empty());
3026

3127
// Get the "extra_attributes" option from the first output. We expect
3228
// all others to be the same.

src/output.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ output_t::create_outputs(std::shared_ptr<middle_query_t> const &mid,
187187
"gazetteer, null, multi].\n"_format(options.output_backend)};
188188
}
189189

190+
if (outputs.empty()) {
191+
throw std::runtime_error{"Must have at least one output, "
192+
"but none have been configured."};
193+
}
194+
190195
return outputs;
191196
}
192197

0 commit comments

Comments
 (0)