3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Return empty array if location field returns NULL.

This commit is contained in:
Paul Weidner 2022-06-13 13:35:15 -07:00 committed by GitHub
parent e3110c8cec
commit 6d13a732d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,7 +191,7 @@ class AssetMoveActionForm extends ConfirmFormBase {
// Load location assets.
$locations = [];
$location_ids = array_column($form_state->getValue('location', []), 'target_id');
$location_ids = array_column($form_state->getValue('location', []) ?? [], 'target_id');
if (!empty($location_ids)) {
$locations = $this->entityTypeManager->getStorage('asset')->loadMultiple($location_ids);
}