mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
add null check for platform
This commit is contained in:
parent
2d00052db6
commit
f62c3135df
2 changed files with 4 additions and 4 deletions
|
|
@ -50,10 +50,10 @@ class Platform
|
|||
/**
|
||||
* Get user-friendly platform name from a scheme.
|
||||
*
|
||||
* @param string $scheme
|
||||
* @param string|null $scheme
|
||||
* @return string Empty string if scheme is not found.
|
||||
*/
|
||||
public static function getNameByScheme(string $scheme): string
|
||||
public static function getNameByScheme(?string $scheme): string
|
||||
{
|
||||
return self::$names[$scheme] ?? '';
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ class Platform
|
|||
{
|
||||
$hostnames = [];
|
||||
foreach ($platforms as $platform) {
|
||||
$type = $platform['type'] ?? self::TYPE_UNKNOWN;
|
||||
$type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN);
|
||||
$hostname = strtolower($platform['hostname'] ?? '');
|
||||
$key = strtolower($platform['key'] ?? '');
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Redirect extends Origin
|
|||
*/
|
||||
public function getDescription(): string
|
||||
{
|
||||
$platform = $this->scheme ? Platform::getNameByScheme($this->scheme) : null;
|
||||
$platform = Platform::getNameByScheme($this->scheme);
|
||||
$host = $this->host ? '(' . $this->host . ')' : '';
|
||||
|
||||
if (empty($this->host) && empty($this->scheme)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue