[icinga-checkins] icinga.org: icingaweb2/master: RepositoryQuery: Avoid cloning sub-objects when they are null

git at icinga.org git at icinga.org
Thu Jun 30 13:16:07 CEST 2016


Module: icingaweb2
Branch: master
Commit: e9681de388a6b3abb7b57323aef331b90bae9494
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=e9681de388a6b3abb7b57323aef331b90bae9494

Author: Markus Frosch <lazyfrosch at icinga.org>
Date:   Thu Jun 30 13:16:05 2016 +0200

RepositoryQuery: Avoid cloning sub-objects when they are null

fixes #12078

---

 library/Icinga/Repository/RepositoryQuery.php |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/library/Icinga/Repository/RepositoryQuery.php b/library/Icinga/Repository/RepositoryQuery.php
index f028b3e..b1cd09a 100644
--- a/library/Icinga/Repository/RepositoryQuery.php
+++ b/library/Icinga/Repository/RepositoryQuery.php
@@ -69,8 +69,12 @@ class RepositoryQuery implements QueryInterface, SortRules, FilterColumns, Itera
      */
     public function __clone()
     {
-        $this->query = clone $this->query;
-        $this->iterator = clone $this->iterator;
+        if ($this->query !== null) {
+            $this->query = clone $this->query;
+        }
+        if ($this->iterator !== null) {
+            $this->iterator = clone $this->iterator;
+        }
     }
 
     /**



More information about the icinga-checkins mailing list