Skip to content

Commit

Permalink
- fix an issue with cloning null paramters in unitmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
Steinar Elgsæter committed Nov 27, 2023
1 parent 8ea9059 commit 17afb91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Dynamic/SimulatableModels/UnitParameters.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Accord.Math;
using System.Collections.Generic;
using System.ComponentModel.Design;
using TimeSeriesAnalysis.Dynamic;

namespace TimeSeriesAnalysis.Dynamic
Expand Down Expand Up @@ -124,7 +125,10 @@ public UnitParameters CreateCopy()
newP.Y_max = Y_max;
newP.TimeConstant_s = TimeConstant_s;
newP.TimeDelay_s = TimeDelay_s;
newP.LinearGains = (double[])LinearGains.Clone();
if (LinearGains == null)
newP.LinearGains = null;
else
newP.LinearGains = (double[])LinearGains.Clone();
if (LinearGainUnc == null)
newP.LinearGainUnc = null;
else
Expand Down
2 changes: 1 addition & 1 deletion TimeSeriesAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
<RepositoryUrl>https://github.com/equinor/timeseriesanalysis</RepositoryUrl>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<Version>1.2.55</Version>
<Version>1.2.56</Version>
<Company>Equinor</Company>
<Authors>Equinor</Authors>
<IncludeSymbols>true</IncludeSymbols>
Expand Down

0 comments on commit 17afb91

Please sign in to comment.