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

dbeaver/pro#3407 Fix AbstractJdbcResultSet.getBigDecimal(int) to handle empty strings #52

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

ivgag
Copy link
Contributor

@ivgag ivgag commented Oct 31, 2024

Ensure getBigDecimal(int) checks for empty strings before processing to avoid potential errors.

…le empty strings

Ensure `getBigDecimal(int)` checks for empty strings before processing to avoid potential errors.
@@ -619,7 +619,11 @@ public Reader getCharacterStream(int columnIndex) throws SQLException {
@Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
final String value = getString(columnIndex);
return value != null ? new BigDecimal(value) : null;
if (value == null || value.trim().isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (value == null || value.trim().isEmpty()) {
if (value == null || value.isBlank()) {

@serge-rider serge-rider merged commit 5fabad6 into devel Nov 6, 2024
2 of 3 checks passed
@serge-rider serge-rider deleted the dbeaver/pro#3407-cover-csv-driver-with-tests branch December 12, 2024 13:18
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

Successfully merging this pull request may close these issues.

4 participants