From ffc5e4b11ecccf886dd07b009b6cf1b74c28974f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 10 Feb 2016 14:36:47 +0200 Subject: [PATCH] Small NPE fix in JS --- static/js/directives/ui/tag-specific-image-view.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/directives/ui/tag-specific-image-view.js b/static/js/directives/ui/tag-specific-image-view.js index 755d7b7ae..26fc7c4b9 100644 --- a/static/js/directives/ui/tag-specific-image-view.js +++ b/static/js/directives/ui/tag-specific-image-view.js @@ -22,12 +22,16 @@ angular.module('quay').directive('tagSpecificImagesView', function () { $scope.getImageListingClasses = function(image) { var classes = ''; + if (!$scope.repository) { + return ''; + } + if (image.ancestors.length > 1) { classes += 'child '; } var currentTag = $scope.repository.tags[$scope.tag]; - if (image.id == currentTag.image_id) { + if (currentTag && image.id == currentTag.image_id) { classes += 'tag-image '; }