BHoM / Excel_UI

GNU Lesser General Public License v3.0
5 stars 4 forks source link

Excel_UI: Excelsheets with Datasets fail to open #365

Closed IsakNaslundBh closed 2 years ago

IsakNaslundBh commented 2 years ago

Description:

If a dataset is existing as a formula in excel sheets, it fails to open due to crashing on https://github.com/BHoM/Excel_UI/blob/8ce74671b0bc20200b4fa0edcf490e9b3d0d8380/Excel_UI/Addin/AddIn_Formulas.cs#L154 with a null reference exception, due to datasets selected item being a string, not a type.

Steps to reproduce:

Add a dataset to an excel sheet. Save and open excel

Expected behaviour:

For load not to crash when a dataset is present somewhere in the sheet.

FraserGreenroyd commented 2 years ago

@IsakNaslundBh is this the same as #338 ?

IsakNaslundBh commented 2 years ago

No, do not think so. Think this was due to the fix added in https://github.com/BHoM/Excel_UI/pull/364 where DatasetCallers are passed to the UpdateEnum method, and then when SelectedItem is extracted a string is returned, not type, leading to a null reference exception on line 154 linked above.

Added double protection against it in the linked PR.

Not sure what #338 is about really.