Skip to content

Commit 3b6905b

Browse files
authored
Merge pull request #15 from nchiasson-dgi/8.x-1.x-return_empty_nids_array
empty nids array is returned if no relationships
2 parents 5da21b4 + f1e924f commit 3b6905b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/EmbargoesEmbargoesService.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,10 @@ public function getParentNidsOfFileEntity(FileInterface $file) {
290290
$relationships = NestedArray::mergeDeep(
291291
file_get_file_references($file),
292292
file_get_file_references($file, NULL, EntityStorageInterface::FIELD_LOAD_REVISION, 'image'));
293-
if (!$relationships) {
294-
$nids = [];
295-
}
296-
else {
293+
$nids = [];
294+
if ($relationships) {
297295
foreach ($relationships as $relationship) {
298-
if (!$relationship) {
299-
$nids = [];
300-
}
301-
else {
296+
if ($relationship) {
302297
foreach ($relationship as $key => $value) {
303298
switch ($key) {
304299
case 'node':

0 commit comments

Comments
 (0)