Skip to content

Commit

Permalink
Resultcube edge case fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gavbrennan committed May 23, 2024
1 parent bd2c92e commit ee9c92f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Qwack.Core/Cubes/ResultCube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public ResultCube(TO_ResultCube transportObject)
_fieldNames = transportObject.FieldNames;
_types = transportObject.Types.ToDictionary(x => x.Key, x => Type.GetType(x.Value));
var types = _fieldNames.Select(x => _types[x]).ToArray();
_rows = transportObject.Rows.Select(x => new ResultCubeRow(x, types)).ToList();
_rows = transportObject.Rows?.Select(x => new ResultCubeRow(x, types)).ToList() ?? new List<ResultCubeRow>();
}

public void Initialize(Dictionary<string, Type> dataTypes)
Expand Down
2 changes: 1 addition & 1 deletion src/Qwack.Core/Curves/EquityPriceCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public EquityPriceCurve(DateTime buildDate, double spot, string ccy, IIrCurve ir
}

public EquityPriceCurve(TO_EquityPriceCurve to, IFundingModel fundingModel, ICurrencyProvider currencyProvider)
: this(to.BuildDate, to.Spot, to.Currency, fundingModel.GetCurve(to.Currency), to.SpotDate, to.PillarDates, to.DivYields, to.DiscreteDivDates,
: this(to.BuildDate, to.Spot, to.Currency, fundingModel?.GetCurve(to.Currency), to.SpotDate, to.PillarDates, to.DivYields, to.DiscreteDivDates,
to.DiscreteDivs, currencyProvider, to.Basis, to.PillarLabels)
{
AssetId = to.AssetId;
Expand Down
2 changes: 2 additions & 0 deletions src/Qwack.Core/Curves/PriceCurveFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static IPriceCurve GetPriceCurve(this TO_PriceCurve transportObject, ICur
if (transportObject.ContangoPriceCurve != null)
return new ContangoPriceCurve(transportObject.ContangoPriceCurve, currencyProvider);

if (transportObject.EquityPriceCurve != null)
return new EquityPriceCurve(transportObject.EquityPriceCurve, null, currencyProvider);

throw new Exception("Unable to build price curve");
}
Expand Down
2 changes: 1 addition & 1 deletion version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<VersionPrefix>0.8.0</VersionPrefix>
<VersionPrefix>0.8.01</VersionPrefix>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0
0.8.01

0 comments on commit ee9c92f

Please sign in to comment.