diff --git a/endpoints/registry.py b/endpoints/registry.py index f650398ec..bd78e6055 100644 --- a/endpoints/registry.py +++ b/endpoints/registry.py @@ -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']: