Skip to content

Commit

Permalink
Protect against null mesh in MooseMesh::prepared
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad authored and jain651 committed Apr 19, 2021
1 parent af68f02 commit 4462046
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion framework/src/mesh/MooseMesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,10 @@ MooseMesh::prepared(bool state)
mooseError("We don't have any right to tell the libmesh mesh that it *is* prepared. Only a "
"call to prepare_for_use should tell us that");

_mesh->set_isnt_prepared();
// Some people may call this even before we have a MeshBase object. This isn't dangerous really
// because when the MeshBase object is born, it knows it's in an unprepared state
if (_mesh)
_mesh->set_isnt_prepared();

// If the libMesh mesh isn't preparead, then our MooseMesh wrapper is also no longer prepared
_moose_mesh_prepared = false;
Expand Down

0 comments on commit 4462046

Please sign in to comment.