diff --git a/functions/classes/class.Radius.php b/functions/classes/class.Radius.php
index 71e17ed1055a5523bdcbbe34a3858cc368265b3d..2168022780d7168989705b88444a3259bda192d5 100644
--- a/functions/classes/class.Radius.php
+++ b/functions/classes/class.Radius.php
@@ -576,7 +576,7 @@ class Radius
     function SetAttribute($type, $value)
     {
         $attribute_index = -1;
-        $attribute_count = count($this->_attributes_to_send);
+        $attribute_count = !is_null($this->_attributes_to_send) ? count($this->_attributes_to_send) : 0;
         for ($attributes_loop = 0; $attributes_loop < $attribute_count; $attributes_loop++)
         {
             if ($type == ord(substr($this->_attributes_to_send[$attributes_loop], 0, 1)))
@@ -716,7 +716,8 @@ class Radius
         }
 
         $attributes_content = '';
-        $attribute_count1 = count($this->_attributes_to_send);
+        $attribute_count1 = !is_null($this->_attributes_to_send) ? count($this->_attributes_to_send) : 0;
+
         for ($attributes_loop = 0; $attributes_loop < $attribute_count1; $attributes_loop++)
         {
             $attributes_content .= $this->_attributes_to_send[$attributes_loop];
diff --git a/misc/CHANGELOG b/misc/CHANGELOG
index f9eedbcefa98bf3b0e52910317e65bd1278fd8a2..77c0f813a9dfb8047ff4368af3daf74ad5078515 100755
--- a/misc/CHANGELOG
+++ b/misc/CHANGELOG
@@ -10,6 +10,7 @@
     + Fixed Update login_form.php for installation inside subdir (#3954);
     + Fixed php8 constructor fix for radius class (#3985);
     + Fixed Force mac address update during status update scan (#3791);
+    + Fixed RADIUS authentication fails on 1.6.0 (#3986);
 
     Enhancements, changes:
     ----------------------------