From 577c1bed953ddecae716583d063f12fff0934436 Mon Sep 17 00:00:00 2001 From: eranetam Date: Sun, 3 Dec 2017 23:25:40 +0200 Subject: [PATCH] remove useless access to the priorityGroup table if partner priorityGroupId is null --- alpha/lib/model/PartnerPeer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpha/lib/model/PartnerPeer.php b/alpha/lib/model/PartnerPeer.php index 552f2c2d6ac..ade9afd8b71 100644 --- a/alpha/lib/model/PartnerPeer.php +++ b/alpha/lib/model/PartnerPeer.php @@ -70,7 +70,7 @@ public static function getPartnerPriorityFactorByPartner($partner) private static function getPriority(Partner $partner) { - $priorityGroup = PriorityGroupPeer::retrieveByPK($partner->getPriorityGroupId()); + $priorityGroup = $partner->getPriorityGroupId() ? PriorityGroupPeer::retrieveByPK($partner->getPriorityGroupId()) : null; if(!$priorityGroup) return PriorityGroup::DEFAULT_PRIORITY;