Skip to content

Commit

Permalink
pkp#8493 submission's uploaded user ID can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Feb 14, 2023
1 parent 13a717e commit 878977b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/submissionFile/maps/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ protected function mapByProperties(array $props, SubmissionFile $submissionFile)
}

if ($prop === 'uploaderUserName') {
$user = Repo::user()->get($submissionFile->getData('uploaderUserId'));
$userId = $submissionFile->getData('uploaderUserId');
$user = !is_null($userId) ? Repo::user()->get($userId) : null; // userId can be null, see pkp/pkp-lib#8493
$output[$prop] = $user?->getUsername() ?? '';

continue;
Expand Down

0 comments on commit 878977b

Please sign in to comment.