Skip to content

Commit 6df8b8c

Browse files
committed
Cleanup in NavItems / TabbedReports
1 parent 96b38d5 commit 6df8b8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

laboratory/src/org/labkey/laboratory/LaboratoryDataProvider.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import java.util.ArrayList;
5858
import java.util.Collections;
5959
import java.util.List;
60+
import java.util.Objects;
6061
import java.util.Set;
6162

6263
/**
@@ -355,13 +356,13 @@ public List<TabbedReportItem> getTabbedReportItems(Container c, User u)
355356
if (!models.isEmpty())
356357
{
357358
items.addAll(models.stream().map(m -> {
358-
if (m.isValid())
359+
if (!m.isValid())
359360
{
360-
_log.error("Invalid tabbed report in container: " + c.getPath() + ", rowId: " + m.getRowId());
361+
return null;
361362
}
362363

363364
return(m.toNavItem(c, u, cache, owner, this));
364-
}).toList());
365+
}).filter(Objects::nonNull).toList());
365366
}
366367

367368
return Collections.unmodifiableList(items);
@@ -417,6 +418,7 @@ public boolean isValid()
417418
{
418419
if (getCategory() == null || getSchemaName() == null || getQueryName() == null)
419420
{
421+
_log.error("Missing either category, schema or query for laboratory.reports item: " + getContainerPath() + ", rowId: " + getRowId());
420422
return false;
421423
}
422424

0 commit comments

Comments
 (0)