Skip to content

Commit

Permalink
Fixed null pointer exception when there is streamApi query library ty…
Browse files Browse the repository at this point in the history
…pe in database
  • Loading branch information
dragonpoo committed Nov 29, 2024
1 parent 3a7fe83 commit 98d1f18
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ private Flux<LibraryQuery> getByOrgIdWithDatasourcePermissions(String orgId) {
Flux<LibraryQuery> libraryQueryFlux = libraryQueryService.getByOrganizationId(orgId)
.cache();

Mono<List<String>> datasourceIdListMono = libraryQueryFlux.map(libraryQuery -> libraryQuery.getQuery().getDatasourceId())
Mono<List<String>> datasourceIdListMono = libraryQueryFlux.map(libraryQuery -> {
var datasourceId = libraryQuery.getQuery().getDatasourceId();
return Objects.requireNonNullElse(datasourceId, "");
})
.filter(StringUtils::isNotBlank)
.collectList()
.cache();
Expand Down

0 comments on commit 98d1f18

Please sign in to comment.