Skip to content

Commit 9b65e1b

Browse files
committed
Fix error when removing all USB Device Filters
After adding USB Device Filters and saving, it was not possible to remove the last filter, an exception occurred on save. The root cause was that USBDeviceFilters is empty when there are no more filters, and count fails. The issue is now fixed.
1 parent 1fc79ba commit 9b65e1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

endpoints/lib/vboxconnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ public function remote_machineSave($args) {
23472347
}
23482348

23492349
// Exists in new?
2350-
if(count($args['USBDeviceFilters'][$i])) {
2350+
if($args['USBDeviceFilters'] && count($args['USBDeviceFilters'][$i])) {
23512351

23522352
// Create filter
23532353
$f = $m->USBDeviceFilters->createDeviceFilter($args['USBDeviceFilters'][$i]['name']);

0 commit comments

Comments
 (0)