fast_excel icon indicating copy to clipboard operation
fast_excel copied to clipboard

Revise NULL pointers that are returned intentionally?

Open datbth opened this issue 3 years ago • 0 comments

See Note number 1 of https://github.com/Paxa/fast_excel/pull/83.

There are cases where Libxlsxwriter returns a NULL pointer intentionally (rather than because of a memory error).
In those cases, I think FastExcel should return nil instead of a Struct of null pointer, especially because further usage on the Struct is likely to yield segmentation fault error and crashes the whole process (rather than just a Ruby RuntimeError when using nil values improperly).

For example:

  • WorkbookWrappers#get_worksheet_by_name when worksheet is not found
  • WorkbookWrappers#default_format when there are no formats?
  • WorksheetWrappers#find_row when row is not found?

datbth avatar Mar 23 '22 17:03 datbth