From a3fe71526d397f4ada2de0da41cc029d840ed9b4 Mon Sep 17 00:00:00 2001 From: Adam Pippin Date: Wed, 17 Feb 2021 02:18:16 -0800 Subject: [PATCH] Bugfix: generating Fn::If without false caused error --- app/Cfnpp/Functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Cfnpp/Functions.php b/app/Cfnpp/Functions.php index 3ca96e8..59aa9bf 100644 --- a/app/Cfnpp/Functions.php +++ b/app/Cfnpp/Functions.php @@ -197,7 +197,10 @@ class Functions $n_if = new Node($n_orig, 'Fn::If'); $n_if->addChild(new NodeValue($n_if, null, $condition_name)); $n_if->addChild($if_true); - $n_if->addChild($if_false); + if (isset($if_false)) + { + $n_if->addChild($if_false); + } return $n_if; }