diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index b691f5732c..795694623c 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -995,9 +995,7 @@ public function addGlobal($name, $value) if (!array_key_exists($name, $this->globals)) { throw new LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); } - } - if ($this->extensionInitialized || $this->runtimeInitialized) { // update the value $this->globals[$name] = $value; } else {