aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Profiler/Profiler.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/private/Profiler/Profiler.php b/lib/private/Profiler/Profiler.php
index 9fd5e76d592..40050b7bf43 100644
--- a/lib/private/Profiler/Profiler.php
+++ b/lib/private/Profiler/Profiler.php
@@ -61,11 +61,19 @@ class Profiler implements IProfiler {
}
public function loadProfile(string $token): ?IProfile {
- return $this->storage->read($token);
+ if ($this->storage) {
+ return $this->storage->read($token);
+ } else {
+ return null;
+ }
}
public function saveProfile(IProfile $profile): bool {
- return $this->storage->write($profile);
+ if ($this->storage) {
+ return $this->storage->write($profile);
+ } else {
+ return false;
+ }
}
public function collect(Request $request, Response $response): IProfile {
@@ -88,7 +96,11 @@ class Profiler implements IProfiler {
*/
public function find(?string $url, ?int $limit, ?string $method, ?int $start, ?int $end,
string $statusCode = null): array {
- return $this->storage->find($url, $limit, $method, $start, $end, $statusCode);
+ if ($this->storage) {
+ return $this->storage->find($url, $limit, $method, $start, $end, $statusCode);
+ } else {
+ return [];
+ }
}
public function dataProviders(): array {