diff --git a/html/includes/table/devices.inc.php b/html/includes/table/devices.inc.php
index 55f09d9f5..3cd85fee1 100644
--- a/html/includes/table/devices.inc.php
+++ b/html/includes/table/devices.inc.php
@@ -206,6 +206,9 @@ foreach (dbFetchRows($sql, $param) as $device) {
$uptime = formatUptime($device['uptime'], 'short').'
'.$location;
if ($subformat == 'detail') {
$hostname .= '
'.$device['sysName'];
+ if (empty($port_count)) {
+ $port_count = 0;
+ }
if ($port_count) {
$col_port = '
'.$port_count.'
';
}