From: wolf Date: Mon, 17 Feb 2003 00:06:28 +0000 (+0000) Subject: Don't segfault if constraint matrix is empty. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9490a05c33a03b374d8b418d5028c8e63e204502;p=dealii-svn.git Don't segfault if constraint matrix is empty. git-svn-id: https://svn.dealii.org/trunk@7106 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index 1bb745694f..38a38a0ff3 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -1100,6 +1100,9 @@ unsigned int ConstraintMatrix::n_constraints () const bool ConstraintMatrix::is_constrained (const unsigned int index) const { + if (lines.size() == 0) + return false; + if (sorted == true) { ConstraintLine index_comparison; @@ -1124,6 +1127,9 @@ bool ConstraintMatrix::is_constrained (const unsigned int index) const bool ConstraintMatrix::is_identity_constrained (const unsigned int index) const { + if (lines.size() == 0) + return false; + if (sorted == true) { ConstraintLine index_comparison;