Skip to content

Commit 523492f

Browse files
committed
fix: prevent error when send null to json_decode
This fixed the follow warning: ``` json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at /var/www/html/apps-extra/richdocuments/lib/Service/CapabilitiesService.php#142 ``` The method `get` return string|null Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 780ca36 commit 523492f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/Service/CapabilitiesService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ protected function sendRequest(IClient $client): string {
139139

140140
private function getParsedCapabilities() {
141141
$response = $this->get();
142+
if (!$response) {
143+
return [];
144+
}
142145
return json_decode($response, true);
143146
}
144147
}

0 commit comments

Comments
 (0)