From 99a90c308f72b5e61f16801b9c920012cdd16ec6 Mon Sep 17 00:00:00 2001 From: labkey-matthewb Date: Thu, 21 Mar 2024 16:21:27 -0700 Subject: [PATCH] Verify ReportId (#740) avoid NPE for bad values --- flow/src/org/labkey/flow/reports/FlowReport.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flow/src/org/labkey/flow/reports/FlowReport.java b/flow/src/org/labkey/flow/reports/FlowReport.java index 32957c04f2..c6e2718aa6 100644 --- a/flow/src/org/labkey/flow/reports/FlowReport.java +++ b/flow/src/org/labkey/flow/reports/FlowReport.java @@ -115,6 +115,8 @@ protected void updateBaseProperties(ContainerUser cu, PropertyValues pvs, BindEx @Override public ActionURL getRunReportURL(ViewContext context) { + if (null == getReportId()) + return null; Container c = ContainerManager.getForId(getDescriptor().getContainerId()); ActionURL url = new ActionURL(ReportsController.ExecuteAction.class, c); url.addParameter("reportId", getReportId().toString()); @@ -129,6 +131,8 @@ public ActionURL getRunReportURL(ViewContext context) @Override public ActionURL getEditReportURL(ViewContext context) { + if (null == getReportId()) + return null; Container c = ContainerManager.getForId(getDescriptor().getContainerId()); ActionURL url = new ActionURL(ReportsController.UpdateAction.class, c); url.addParameter("reportId", getReportId().toString());