diff --git a/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java b/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java index b9d8acf5c5..bd2363ba1c 100644 --- a/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java +++ b/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java @@ -1149,7 +1149,7 @@ public class SqlserverQueryProvider extends QueryProvider { String whereValue = ""; if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) { - if(request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) { + if(request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) { whereValue = "(" + value.stream().map(str -> { return "N" + "'" + str + "'"; }).collect(Collectors.joining(",")) + ")"; @@ -1171,7 +1171,7 @@ public class SqlserverQueryProvider extends QueryProvider { } } else { - if(request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")){ + if(request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")){ whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE_CH, value.get(0)); }else { whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE, value.get(0));