Skip to content

Commit

Permalink
fix: Guard against empty profiles (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored May 16, 2023
1 parent 695d3d1 commit b545881
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Profiling/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ public function stop(): void
}
}

public function getProfile(): Profile
public function getProfile(): ?Profile
{
if (null === $this->profiler) {
return null;
}

return $this->profile;
}

Expand Down

0 comments on commit b545881

Please sign in to comment.