Handle potential NPE in the registry code

This commit is contained in:
Joseph Schorr 2014-07-03 17:18:14 -04:00
parent ddb9e5d30d
commit e850d17e29

View file

@ -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']: