From 552f62adf0957a35113f55594144d2422a0ab2d0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 10 Jul 2021 13:36:36 +0100 Subject: [PATCH] script: lower: Bail early if no targets Signed-off-by: Ian Jackson --- templates/script.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/script.ts b/templates/script.ts index 150353b0..e43819c1 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -646,10 +646,13 @@ function lower_pieces(targets_todo: LowerTodoList): let bottommost_unbottom : Entry | null = null; let n_targets_todo_unbottom = 0; + let any_targets = false; for (const piece of Object.keys(targets_todo)) { + any_targets = true; let p = targets_todo[piece]; if (!p.bottom) n_targets_todo_unbottom++; } + if (!any_targets) return 'Nothing to lower!'; let walk = pieces_marker; for (;;) { // starting at the bottom of the stack order -- 2.30.2