Handle potential NPE in the registry code
This commit is contained in:
parent
ddb9e5d30d
commit
e850d17e29
1 changed files with 5 additions and 0 deletions
|
@ -412,6 +412,11 @@ def put_image_json(namespace, repository, image_id):
|
|||
|
||||
profile.debug('Looking up repo image')
|
||||
repo_image = model.get_repo_image(namespace, repository, image_id)
|
||||
if not repo_image:
|
||||
profile.debug('Image not found')
|
||||
abort(404, 'Image %(image_id)s not found', issue='unknown-image',
|
||||
image_id=image_id)
|
||||
|
||||
uuid = repo_image.storage.uuid
|
||||
|
||||
if image_id != data['id']:
|
||||
|
|
Reference in a new issue