TableView icon indicating copy to clipboard operation
TableView copied to clipboard

Wrong number of cells in a row crashes

Open pe1uca opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. Because of a mistake I made when migrating from another table library, I left an extra column cell (old library's corner)
This makes TableView to crash here with a NullPointerException https://github.com/evrencoskun/TableView/blob/cf9c7f66e764aee2c6f30df816ca21c270ecd01a/tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/ColumnHeaderLayoutManager.java#L96-L99

Describe the solution you'd like Make TableView library gracefully handle this case.
When commenting this line I was able to prevent the app from crashing https://github.com/evrencoskun/TableView/blob/cf9c7f66e764aee2c6f30df816ca21c270ecd01a/tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/CellLayoutManager.java#L258

The table will look wrong, but I think is better than the misleading NullPointerException.

Additional context I followed the wiki for this example, only replacing object by string as data.

pe1uca avatar Feb 01 '22 01:02 pe1uca