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-unsubscr...@brooklyn.apache.org

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

Reply via email to