Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spreadsheet throws exception when deleteRows is called and no cell is selected in the spreadsheet #842

Open
KochTobi opened this issue Nov 24, 2023 · 0 comments

Comments

@KochTobi
Copy link

KochTobi commented Nov 24, 2023

The method deleteRows produces a NullPointerException.
java.lang.NullPointerException: Cannot invoke "org.apache.poi.ss.util.CellReference.getRow()" because "selectedCellReference" is null

https://github.com/vaadin/spreadsheet/blob/317684df11cdb37c29ca5824afc756584aa714e2/vaadin-spreadsheet/src/main/java/com/vaadin/addon/spreadsheet/Spreadsheet.java#L2357C10-L2357C10

Here, the cell reference of the currently selected cell is used. There is no check for null here, so when no cell is selected, deleting rows is not possible and an exception is thrown.
This should not be the case.
You should be able to delete rows without selecting a cell first (using a button in the UI or something else that uses the java API).

Vaadin version: 24.1.6
Java Version: 17.0.7 Zulu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant