Skip to content

Commit

Permalink
TIM-70: Do not crash on invalid user IDs in controlling export
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske authored and CybotTM committed Oct 17, 2023
1 parent 4c7fbb0 commit 445da2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Netresearch/TimeTrackerBundle/Services/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public function getUsername($userId = null)
$user = $this->container->get('doctrine')
->getRepository('NetresearchTimeTrackerBundle:User')
->find($userId);
$username = $user->getUsername();
if ($user !== null) {
$username = $user->getUsername();
}
}

return $username;
Expand Down

0 comments on commit 445da2c

Please sign in to comment.