Use cached function for financialAccount retrieval.
[civicrm-core.git] / CRM / Financial / BAO / FinancialAccount.php
index 9e37d4ceaf4db9f34c7ede44bcde362ab9ba4930..c23542e997f8a9ab3834030986673f0bcd962f48 100644 (file)
@@ -263,7 +263,9 @@ WHERE cft.id = %1
           Civi::$statics[__CLASS__]['entity_financial_account'][$financialTypeID][$accountRelationshipID] = $incomeAccountFinancialAccountID;
         }
       }
-
+      if (!isset(Civi::$statics[__CLASS__]['entity_financial_account'][$financialTypeID][$relationTypeId])) {
+        Civi::$statics[__CLASS__]['entity_financial_account'][$financialTypeID][$relationTypeId] = NULL;
+      }
     }
     return Civi::$statics[__CLASS__]['entity_financial_account'][$financialTypeID][$relationTypeId];
   }