forked from github/dataease
Merge pull request #2590 from dataease/pr@dev@fix_dataset_paramter
fix(数据集): 带参数的数据集设置仪表板过滤器报错空指针
This commit is contained in:
commit
834cab55e8
@ -649,7 +649,7 @@ public class ChartViewService {
|
||||
boolean hasParameters = false;
|
||||
if (StringUtils.isNotEmpty(table.getSqlVariableDetails())) {
|
||||
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType());
|
||||
for (String parameter : request.getParameters()) {
|
||||
for (String parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>()) ) {
|
||||
if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) {
|
||||
hasParameters = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user