From 1cdadf452135c872eca21795197be47a40ea1ba6 Mon Sep 17 00:00:00 2001 From: Adam Pippin Date: Sun, 14 Feb 2021 17:24:56 -0800 Subject: [PATCH] Have dependency graph throw an exception rather than return nothing when no edge nodes are present --- app/Util/DependencyGraph.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Util/DependencyGraph.php b/app/Util/DependencyGraph.php index f88e24d..f675467 100644 --- a/app/Util/DependencyGraph.php +++ b/app/Util/DependencyGraph.php @@ -105,6 +105,11 @@ class DependencyGraph } } + if (sizeof($state) == 0) + { + throw new \Exception('Cannot solve dependency graph -- no edge nodes. Circular dependency?'); + } + // Then walk through the array and insert each node's dependencies before // it recursively. $iter = 0;