Skip to content

Commit

Permalink
NPE fixes for creating search
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Jan 25, 2023
1 parent e2dda98 commit f416b99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private Search<C> createSearch() {
}

protected SearchContext createAdditionalSearchContext() {
return new SearchContext();
return null;
}

private void initLayout() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ private SearchItemsType createSearchItemsForType() {
private List<SearchItemType> createSearchItemList() {
List<SearchItemType> searchItems = new ArrayList<>();

if (additionalSearchContext.getReportCollection() != null) {
return createReportSearchItems(additionalSearchContext.getReportCollection());
if (getReportCollection() != null) {
return createReportSearchItems(getReportCollection());
}

for (ItemPath path : availableDefinitions.keySet()) {
Expand All @@ -148,6 +148,13 @@ private List<SearchItemType> createSearchItemList() {
return searchItems;
}

private ObjectCollectionReportEngineConfigurationType getReportCollection(){
if (additionalSearchContext == null) {
return null;
}
return additionalSearchContext.getReportCollection();
}

private boolean isDeadItemForProjections(ItemPath path) {
if (CollectionPanelType.PROJECTION_SHADOW != collectionPanelType) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ private void initTimestampForAudit(Search<C> search) {
}

private void initAssociationWrapperIfNeeded(Search<C> search) {
if (additionalSearchContext == null) {
return;
}
if (CollectionPanelType.ASSOCIABLE_SHADOW.equals(additionalSearchContext.getPanelType())) {
AssociationSearchItemWrapper wrapper = new AssociationSearchItemWrapper(additionalSearchContext.getResourceObjectDefinition());
search.getItems().add(0, wrapper);
Expand Down

0 comments on commit f416b99

Please sign in to comment.