Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(input): check that containerCtrl.label is defined before accessing it #12035

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

Splaktar
Copy link
Contributor

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

TypeError: Cannot read property 'toggleClass' of null

Issue Number:
Fixes #10831

What is the new behavior?

No exception as we check that containerCtrl.label is defined before calling containerCtrl.label.toggleClass('md-required', value && !mdNoAsterisk);.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@google-cla google-cla bot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Oct 25, 2020
@Splaktar Splaktar self-assigned this Oct 25, 2020
@Splaktar Splaktar added this to the 1.2.2 milestone Oct 25, 2020
@Splaktar Splaktar requested a review from wagnermaciel October 25, 2020 02:23
@Splaktar Splaktar added P3: important Important issues that really should be fixed when possible. pr: merge ready This PR is ready for a caretaker to review type: bug labels Oct 25, 2020
Copy link
Contributor

@wagnermaciel wagnermaciel left a comment

Choose a reason for hiding this comment

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

lgtm

@Splaktar Splaktar added the pr: lgtm This PR has been approved by the reviewer label Oct 26, 2020
@Splaktar Splaktar merged commit f79186f into master Oct 26, 2020
@Splaktar Splaktar deleted the input-toggleClass-of-null branch October 26, 2020 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P3: important Important issues that really should be fixed when possible. pr: lgtm This PR has been approved by the reviewer pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

input: label does not exist when 'required' attribute changes, throws "Cannot read property 'toggleClass' of null"
2 participants