MPPIC: IsotropyModel: Prevent null pointer access on copy construct

This commit is contained in:
Will Bainbridge
2022-12-13 16:05:04 +00:00
parent d122c32cd8
commit 06217ffce0

View File

@ -63,7 +63,12 @@ Foam::IsotropyModel<CloudType>::IsotropyModel
)
:
CloudSubModelBase<CloudType>(cm),
timeScaleModel_(cm.timeScaleModel_->clone())
timeScaleModel_
(
cm.timeScaleModel_.valid()
? cm.timeScaleModel_->clone().ptr()
: nullptr
)
{}