Skip to content

Commit eb31292

Browse files
committed
fix(targetticket,targetchange): avoid possible PHP warning
Signed-off-by: Thierry Bugier <[email protected]>
1 parent c3d2ba2 commit eb31292

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

inc/targetbase.class.php

+4
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ protected function setTargetEntity($data, PluginFormcreatorFormAnswer $formanswe
315315
foreach ($res_entities as $entity) {
316316
$data_entities[] = $entity;
317317
}
318+
if (count($data_entities) < 1) {
319+
// No entity found
320+
break;
321+
}
318322
$first_entity = array_shift($data_entities);
319323
$entityId = $first_entity[$entityFk];
320324
break;

0 commit comments

Comments
 (0)