Skip to content

Commit

Permalink
fix(targetticket,targetchange): avoid possible PHP warning
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 29, 2020
1 parent c3d2ba2 commit eb31292
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/targetbase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ protected function setTargetEntity($data, PluginFormcreatorFormAnswer $formanswe
foreach ($res_entities as $entity) {
$data_entities[] = $entity;
}
if (count($data_entities) < 1) {
// No entity found
break;
}
$first_entity = array_shift($data_entities);
$entityId = $first_entity[$entityFk];
break;
Expand Down

0 comments on commit eb31292

Please sign in to comment.