diff --git a/src/Sql/Clause/Join.php b/src/Sql/Clause/Join.php index 7156423..d62557a 100644 --- a/src/Sql/Clause/Join.php +++ b/src/Sql/Clause/Join.php @@ -188,14 +188,14 @@ public function __get(string $name) return $this->specification; } if ('on' === $name) { + if ($this->specification instanceof On) { + return $this->specification; + } if ($this->specification === null) { $this->specification = new On(); $this->specification->setParent($this); return $this->specification; } - if ($this->specification instanceof On) { - return $this->specification; - } return null; }