Skip to content

Bug fix 1389239 - Hang due to undefined object when no storage class … #749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2016
Merged

Conversation

zherman0
Copy link
Member

Hang due to undefined object when no storage class is selected

@@ -78,7 +78,7 @@ angular.module('openshiftConsole')
var unit = $scope.claim.unit || "Mi";
pvc.spec.resources.requests.storage = $scope.claim.amount + unit;
pvc.spec.selector.matchLabels = keyValueEditorUtils.mapEntries( keyValueEditorUtils.compactEntries($scope.claim.selectedLabels) );
if ($scope.claim.storageClass !== null) {
if ( typeof($scope.claim.storageClass ) !== "undefined" && $scope.claim.storageClass !== null ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply check

if ($scope.claim.storageClass) { ... }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spadgett - that still does not seem to handle the undefined case which occurs when the user chooses no storage class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When $scope.claim.storageClass is undefined, that if will evaluate to false.

@spadgett spadgett self-assigned this Oct 27, 2016
@zherman0
Copy link
Member Author

@spadgett - On further testing, that does work for all cases. Code updated. Thanks.

@spadgett
Copy link
Member

[merge]

@openshift-bot
Copy link

Evaluated for origin web console merge up to cd83986

@openshift-bot
Copy link

openshift-bot commented Oct 27, 2016

Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/590/) (Base Commit: 8fa3e93)

@openshift-bot openshift-bot merged commit de8aca5 into openshift:master Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants