Skip to content
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

throwing badly named exception when selector matches no resutls. #78

Open
bzmw opened this issue Jun 20, 2014 · 1 comment
Open

throwing badly named exception when selector matches no resutls. #78

bzmw opened this issue Jun 20, 2014 · 1 comment

Comments

@bzmw
Copy link

bzmw commented Jun 20, 2014

The current version of prettyCheckable throws an exception that doesn't really make a lot of sense when the selector doesn't match anything found in the DOM.
On my project I have added the following to stop it from throwing exceptions.

       instance = this.data( dataPlugin );

 +        if (!instance) {
 +          console.warn("prettyCheckable: Selector returned no results");
 +          return;
 +        }
 +
          instance.element = this;
@arthurgouveia
Copy link
Owner

Wouldn't you consider making a PR?

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

No branches or pull requests

2 participants