Fix bug in component table (#12730)

* Fix bug in component table

* use !empty
This commit is contained in:
Tony Murray
2021-04-08 10:27:20 -05:00
committed by GitHub
parent 6f02ddfe7b
commit 78dd6f305c

View File

@@ -63,6 +63,6 @@ $output = [
'current' => $current,
'rowCount' => $rowCount,
'rows' => $response,
'total' => count($COMPONENTS[$device_id]),
'total' => ! empty($COMPONENTS[$device_id]) ? count($COMPONENTS[$device_id]) : 0,
];
echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);