Fix null pointer issue in SqlDatabaseContentRetriever when column value is null (#1161)
This pull request addresses the null pointer exception issue in the `SqlDatabaseContentRetriever` class that occurs when a certain column value from a database query is null. The code now includes a check for null values before attempting to access them.
This commit is contained in:
parent
9d229e9756
commit
8eccd34c68
|
@ -330,7 +330,9 @@ public class SqlDatabaseContentRetriever implements ContentRetriever {
|
|||
while (resultSet.next()) {
|
||||
List<String> columnValues = new ArrayList<>();
|
||||
for (int i = 1; i <= columnCount; i++) {
|
||||
String columnValue = resultSet.getObject(i).toString();
|
||||
|
||||
String columnValue = resultSet.getObject(i)==null?"":resultSet.getObject(i).toString();
|
||||
|
||||
if (columnValue.contains(",")) {
|
||||
columnValue = "\"" + columnValue + "\"";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue