Fix an exception in viewer, when client had an empty away message

This commit is contained in:
Wruczek 2020-10-23 18:06:46 +02:00
parent c751001c61
commit 9a5e05ca84
1 changed files with 10 additions and 3 deletions

View File

@ -224,7 +224,8 @@ EOD;
$this->add(
$html,
$isQuery ? " is-query" : "", $client["client_database_id"],
$isQuery ? " is-query" : "",
$client["client_database_id"],
$clientIcon,
$clientName,
$suffixIcons
@ -284,7 +285,13 @@ EOD;
}
if($client["client_away"]) {
return $this->getIcon("away.svg", Utils::escape($client["client_away_message"]) ?: __get("VIEWER_CLIENT_AWAY"));
if ($client["client_away_message"] !== null) {
$awayTooltip = Utils::escape($client["client_away_message"]);
} else {
$awayTooltip = __get("VIEWER_CLIENT_AWAY");
}
return $this->getIcon("away.svg", $awayTooltip);
}
if(!$client["client_output_hardware"]) {