Skip to content

Commit

Permalink
Prevent exception when trying to log an exception without a specific …
Browse files Browse the repository at this point in the history
…source.
  • Loading branch information
heathdutton committed May 11, 2018
1 parent 7610515 commit 0fcee2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Model/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Yaml;

/**
* Class Api.
Expand Down Expand Up @@ -1355,7 +1354,6 @@ private function logResults()
$this->contactSource,
$this->status,
$this->contact,
//Yaml::dump($this->logs, 10, 2),
$this->getLogsJSON(),
$message
);
Expand All @@ -1376,7 +1374,10 @@ private function logResults()
}
}
// File-based logging.
$this->logger->log($statLevel, 'Contact Source '.$this->contactSource->getId().': '.$message);
$this->logger->log(
$statLevel,
'Contact Source '.($this->contactSource ? $this->contactSource->getId() : 'NA').': '.$message
);
}

/**
Expand Down

0 comments on commit 0fcee2b

Please sign in to comment.