From 1e91943c4867bec6474d4c4024d0810a3e633ac0 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 30 Apr 2018 18:35:24 +0200 Subject: [PATCH] Guard accessing values in Vector::zero_out_ghosts --- include/deal.II/lac/la_parallel_vector.templates.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index c3619ddc60..fd40922872 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -517,9 +517,10 @@ namespace LinearAlgebra void Vector::zero_out_ghosts () const { - std::fill_n (&values[partitioner->local_size()], - partitioner->n_ghost_indices(), - Number()); + if (values != nullptr) + std::fill_n (&values[partitioner->local_size()], + partitioner->n_ghost_indices(), + Number()); vector_is_ghosted = false; } -- 2.39.5