fvMesh: Check the topoChanger is allocated in the topoChanging() function

This commit is contained in:
Henry Weller
2023-06-29 09:35:04 +01:00
parent 16012dccda
commit 1ae1091f36

View File

@ -646,13 +646,15 @@ Foam::fvMesh::~fvMesh()
bool Foam::fvMesh::topoChanging() const
{
return topoChanger_->dynamic();
return topoChanger_.valid() && topoChanger_->dynamic();
}
bool Foam::fvMesh::dynamic() const
{
return topoChanger_->dynamic() || mover_->dynamic();
return
(topoChanger_.valid() && topoChanger_->dynamic())
|| (mover_.valid() && mover_->dynamic());
}