Skip to content

Commit

Permalink
Fixes #2199 Move DistributionType updates for cloning to the proper c…
Browse files Browse the repository at this point in the history
…lass (#2200)
  • Loading branch information
rwmcintosh committed Jan 24, 2024
1 parent 1729908 commit f299281
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/OSPSuite.Core/Domain/Builder/IndividualParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public override void UpdatePropertiesFrom(IUpdatable source, ICloneManager clone
{
base.UpdatePropertiesFrom(source, cloneManager);
var sourceIndividualParameter = source as IndividualParameter;
if (sourceIndividualParameter == null) return;
if (sourceIndividualParameter == null)
return;

DistributionType = sourceIndividualParameter.DistributionType;
Info = sourceIndividualParameter.Info?.Clone();
Origin = sourceIndividualParameter.Origin?.Clone();
IsDefault = sourceIndividualParameter.IsDefault;
Expand Down
6 changes: 4 additions & 2 deletions src/OSPSuite.Core/Domain/Builder/PathAndValueEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ public double? Value
public override void UpdatePropertiesFrom(IUpdatable source, ICloneManager cloneManager)
{
base.UpdatePropertiesFrom(source, cloneManager);
var sourcePathAndValueEntity = source as PathAndValueEntity;
if (sourcePathAndValueEntity == null) return;

if (!(source is PathAndValueEntity sourcePathAndValueEntity))
return;

DistributionType = sourcePathAndValueEntity.DistributionType;
Value = sourcePathAndValueEntity.Value;
ContainerPath = sourcePathAndValueEntity.ContainerPath.Clone<ObjectPath>();
DisplayUnit = sourcePathAndValueEntity.DisplayUnit;
Expand Down

0 comments on commit f299281

Please sign in to comment.