Skip to content

Commit

Permalink
Fix lifespan datatype (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
IsakNaslundBh authored Sep 13, 2024
2 parents 4e949fb + 9eb68e8 commit fd62047
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CarbonQueryDatabase_Adapter/Convert/ToBHoM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static EnvironmentalProductDeclaration ToEnvironmentalProductDeclaration(
double density = ConvertToSI(densityVal, densityUnits);
string gwp = obj.PropertyValue("gwp")?.ToString() ?? "";
double gwpVal = (gwp == "") ? double.NaN : System.Convert.ToDouble(gwp.Substring(0, gwp.IndexOf(" "))) * epdUnitMult;
int lifespan = (int)(obj.PropertyValue("reference_service_life") ?? 0);
int lifespan = int.TryParse(obj.PropertyValue("reference_service_life")?.ToString() ?? "", out result) ? result : 0;
int referenceYear = int.TryParse(obj.PropertyValue("date_of_issue")?.ToString() ?? "", out result) ? result : 0;

string publisherNames = "";
Expand Down

0 comments on commit fd62047

Please sign in to comment.