diff --git a/experiment/src/org/labkey/experiment/ExperimentRunGraph.java b/experiment/src/org/labkey/experiment/ExperimentRunGraph.java index b9128794c0c..cf7a52cb2d0 100644 --- a/experiment/src/org/labkey/experiment/ExperimentRunGraph.java +++ b/experiment/src/org/labkey/experiment/ExperimentRunGraph.java @@ -49,11 +49,23 @@ public static void renderSvg(Writer out, Container c, ExpRunImpl run, boolean de private static String getSvg(String dot) throws ExecuteException { Graphviz graph = DotParser.parse(dot); - String svg = graph.toSvgStr(); - // Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than - // the old image-based ones, but monitors are much higher resolution than when those were scaled. - return SvgUtil.scaleSize(svg, 0.5f); + if (graph.isEmpty()) + return ""; // Graphviz.toSvgStr() throws an exception if the graph is empty. + + try + { + String svg = graph.toSvgStr(); + + // Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than + // the old image-based ones, but monitors are much higher resolution than when those were scaled. + return SvgUtil.scaleSize(svg, 0.5f); + } + catch (ExecuteException ex) + { + LOG.warn("Error generating graph", ex); + throw ex; + } } private static String getDotGraph(Container c, ExpRunImpl run, boolean detail, String focus, String focusType) diff --git a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp index 01caafdfa75..0f7917c4db0 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp +++ b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp @@ -69,7 +69,7 @@ } catch (ExecuteException e) { - out.print("

Error rendering graph

"); + out.write("

Error rendering graph

"); } if (isSummaryView)