Skip to content

Commit 45708ca

Browse files
Fix error when reading in linear mode from file-based Series (#1748)
* Simple fix for error when reading in linear mode from file-based S * Remove debugging output
1 parent 7491a9b commit 45708ca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Series.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,9 +1288,16 @@ void Series::flushFileBased(
12881288
bool flushIOHandler)
12891289
{
12901290
auto &series = get();
1291-
if (end == begin)
1291+
/*
1292+
* Iterations might have been present, but have been closed and deleted from
1293+
* internal structures. In this case, previous flushes were successful and
1294+
* the Series is now in written() state.
1295+
*/
1296+
if (end == begin && !written())
1297+
{
12921298
throw std::runtime_error(
12931299
"fileBased output can not be written with no iterations.");
1300+
}
12941301

12951302
switch (IOHandler()->m_frontendAccess)
12961303
{

0 commit comments

Comments
 (0)