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
1 changed files with 1 additions and 1 deletions

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);
}