You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "ahgittin (via GitHub)" <gi...@apache.org> on 2023/01/25 12:00:06 UTC

[GitHub] [brooklyn-ui] ahgittin commented on a diff in pull request #370: fix for missing version in 'View in Catalog' link

ahgittin commented on code in PR #370:
URL: https://github.com/apache/brooklyn-ui/pull/370#discussion_r1086550577


##########
ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js:
##########
@@ -208,12 +208,14 @@ export function CatalogItemModalController($scope, $filter, blueprintService, pa
     };
 
     $scope.getCatalogURL = () => {
+        const urlPartVersion = $scope.config.current.version || $scope.config.version;

Review Comment:
   is `$scope.config.current` guaranteed to be an object at this point?  if not we risk introducing errors with this change.
   
   i'm usually inclined to be defensive eg
   
   `urlPartVersion = ($scope.config.current || {}).version || $scope.config.version`
   
   and possibly an `if (!urlPartVersion) return '';` (though this is _more_ defensive than it was previously)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org