Properly check if variable is set before referencing it

For PHP 7.4
This commit is contained in:
Tsvetan Koshutanski 2021-03-23 15:12:42 +02:00 committed by Fedor A. Fetisov
parent 33fb35bd34
commit 62ad932aa7

View File

@ -446,9 +446,10 @@ function setup_chatview_for_user(
// Set default operator's avatar // Set default operator's avatar
$operator = operator_by_id($thread->agentId); $operator = operator_by_id($thread->agentId);
$data['chat']['avatar'] = $operator['vcavatar'] $data['chat']['avatar'] = '';
? $asset_url_generator->generate($operator['vcavatar']) if (!empty($operator['vcavatar'])) {
: ''; $data['chat']['avatar'] = $asset_url_generator->generate($operator['vcavatar']);
}
return $data; return $data;