Skip to content
Snippets Groups Projects
Commit 9574d772 authored by srosse's avatar srosse
Browse files

OO-3825: additional check during collection of questions for bulk op.

parent f6e79da6
No related branches found
No related tags found
No related merge requests found
...@@ -371,28 +371,28 @@ public class QuestionListController extends AbstractItemListController implement ...@@ -371,28 +371,28 @@ public class QuestionListController extends AbstractItemListController implement
private List<QuestionItemShort> getRemovableItems() { private List<QuestionItemShort> getRemovableItems() {
return getItemsTable().getMultiSelectedIndex().stream() return getItemsTable().getMultiSelectedIndex().stream()
.map(index -> getModel().getObject(index.intValue())) .map(index -> getModel().getObject(index.intValue()))
.filter(itemRow -> itemRow.getSecurityCallback().canRemove()) .filter(itemRow -> itemRow != null && itemRow.getSecurityCallback().canRemove())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
private List<QuestionItemShort> getDeletableItems() { private List<QuestionItemShort> getDeletableItems() {
return getItemsTable().getMultiSelectedIndex().stream() return getItemsTable().getMultiSelectedIndex().stream()
.map(index -> getModel().getObject(index.intValue())) .map(index -> getModel().getObject(index.intValue()))
.filter(itemRow -> itemRow.getSecurityCallback().canDelete()) .filter(itemRow -> itemRow != null && itemRow.getSecurityCallback().canDelete())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
private List<QuestionItemShort> getAuthorsEditableItems() { private List<QuestionItemShort> getAuthorsEditableItems() {
return getItemsTable().getMultiSelectedIndex().stream() return getItemsTable().getMultiSelectedIndex().stream()
.map(index -> getModel().getObject(index.intValue())) .map(index -> getModel().getObject(index.intValue()))
.filter(itemRow -> itemRow.getSecurityCallback().canEditAuthors()) .filter(itemRow -> itemRow != null && itemRow.getSecurityCallback().canEditAuthors())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
private List<ItemRow> getMetadataEditableItems() { private List<ItemRow> getMetadataEditableItems() {
return getItemsTable().getMultiSelectedIndex().stream() return getItemsTable().getMultiSelectedIndex().stream()
.map(index -> getModel().getObject(index.intValue())) .map(index -> getModel().getObject(index.intValue()))
.filter(itemRow -> itemRow.getSecurityCallback().canEditMetadata()) .filter(itemRow -> itemRow != null && itemRow.getSecurityCallback().canEditMetadata())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment