Skip to content

Commit 7e64574

Browse files
authored
Merge pull request #46 from ppavlovic/master
Fix FATAL error when setProfiler() was not called when initializing Tasker Runner
2 parents a5376d1 + 13611a1 commit 7e64574

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Tasker2/Runner.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ public function clearProfilerData()
107107

108108
public function registerProfilerTicker(\G4\Profiler\Ticker\TickerAbstract $profiler)
109109
{
110+
if (!$this->profiler instanceof Profiler) {
111+
return $this;
112+
}
110113
$this->profiler->addProfiler($profiler);
111114
return $this;
112115
}
@@ -207,8 +210,10 @@ private function logTaskStart()
207210

208211
private function logTaskExecution()
209212
{
210-
if ($this->logger !== null) {
213+
if ($this->profiler) {
211214
$this->taskerExecution->setProfiler($this->profiler);
215+
}
216+
if ($this->logger !== null) {
212217
$this->logger->log($this->taskerExecution);
213218
}
214219
if ($this->profiler) {

0 commit comments

Comments
 (0)