Skip to content

Commit

Permalink
Merge pull request #15270 from adrianschroeter/fix_crash_repo
Browse files Browse the repository at this point in the history
[api] fix crash on invalid repository
  • Loading branch information
bmwiedemann committed Nov 27, 2023
2 parents 1acc22d + 7a6a226 commit c6bcdb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/app/controllers/source_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ def project_command_release

def _check_single_target!(source_repository, target_repository)
# checking write access and architectures
raise UnknownRepository, 'Invalid source repository' unless source_repository
raise UnknownRepository, 'Invalid target repository' unless target_repository
raise CmdExecutionNoPermission, "no permission to write in project #{target_repository.project.name}" unless User.session!.can_modify?(target_repository.project)

source_repository.check_valid_release_target!(target_repository)
Expand Down

0 comments on commit c6bcdb8

Please sign in to comment.