Skip to content

Commit

Permalink
fixed constructor for nonexisting company
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Nov 22, 2023
1 parent a202e7e commit 0992e6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AbraFlexi/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public function __construct($init = null, $options = [])
public function processInit($init)
{
parent::processInit($init);
if (is_array($init) && array_key_exists('dbNazev', $init)) {
if (is_array($init) && array_key_exists('dbNazev', $init) && $this->autoload) {
$companyInfo = $this->getFlexiData('/c/' . $init['dbNazev']);
if (!array_key_exists('message', $companyInfo)) {
if (is_array($companyInfo) && !array_key_exists('message', $companyInfo)) {
$this->takeData(current($companyInfo));
}
}
Expand Down

0 comments on commit 0992e6b

Please sign in to comment.