From: bangerth Date: Thu, 7 Jul 2011 14:53:20 +0000 (+0000) Subject: Do not access the first element if the vector is empty. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5577b17ef5c0d6c8e874013072b292dbd955c47a;p=dealii-svn.git Do not access the first element if the vector is empty. git-svn-id: https://svn.dealii.org/trunk@23929 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/numerics/data_out.cc b/deal.II/source/numerics/data_out.cc index 7ddccfe5d0..f5bd839985 100644 --- a/deal.II/source/numerics/data_out.cc +++ b/deal.II/source/numerics/data_out.cc @@ -1094,15 +1094,16 @@ void DataOut::build_patches (const Mapping::build_one_patch, - *this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, - curved_cell_region), - std_cxx1x::bind(&internal::DataOut::append_patch_to_list, - std_cxx1x::_1, std_cxx1x::ref(this->patches)), - thread_data, - sample_patch); + if (all_cells.size() > 0) + WorkStream::run (&all_cells[0], + &all_cells[0]+all_cells.size(), + std_cxx1x::bind(&DataOut::build_one_patch, + *this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, + curved_cell_region), + std_cxx1x::bind(&internal::DataOut::append_patch_to_list, + std_cxx1x::_1, std_cxx1x::ref(this->patches)), + thread_data, + sample_patch); }