diff --git a/src/textord/colfind.cpp b/src/textord/colfind.cpp index d7b27bee..c8e6d0bf 100644 --- a/src/textord/colfind.cpp +++ b/src/textord/colfind.cpp @@ -926,7 +926,8 @@ void ColumnFinder::ComputeMeanColumnGap(bool any_multi_column) { &gap_samples); } mean_column_gap_ = any_multi_column && gap_samples > 0 - ? total_gap / gap_samples : total_width / width_samples; + ? total_gap / gap_samples : width_samples > 0 + ? total_width / width_samples : 0; } //////// Functions that manipulate ColPartitions in the part_grid_ /////