[k-way] fix a crash with empty files