From 49d885f19fc890f764b54711afb24e63d2639bf5 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 27 Aug 2024 00:46:20 -0600 Subject: [PATCH] Update voicemails.php Prevent an error when the voicemails array is empty --- app/voicemails/resources/dashboard/voicemails.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index efa96fd972..fc85dcac20 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -36,7 +36,7 @@ //sum total and new $messages['total'] = 0; $messages['new'] = 0; - if (sizeof($voicemails) > 0) { + if (!empty($voicemails) && sizeof($voicemails) > 0) { foreach($voicemails as $field) { $messages[$field['voicemail_uuid']]['ext'] = $field['voicemail_id']; $messages[$field['voicemail_uuid']]['total'] = 0; @@ -107,7 +107,7 @@ if ($dashboard_details_state != 'disabled') { echo "
"; - if (sizeof($voicemails) > 0) { + if (!empty($voicemails) && sizeof($voicemails) > 0) { echo ""; echo ""; echo " ";
".$text['label-voicemail']."