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

TypeError when calling getSQL with invalid rules #595

Closed
eagano opened this issue Nov 10, 2017 · 0 comments
Closed

TypeError when calling getSQL with invalid rules #595

eagano opened this issue Nov 10, 2017 · 0 comments
Labels
bug Identified bug which needs a fix
Milestone

Comments

@eagano
Copy link

eagano commented Nov 10, 2017

The getSQL() function is throwing a TypeError when there is at least one invalid rule present.

Steps to reproduce, from the QueryBuilder demo page (http://querybuilder.js.org/demo.html):

  1. scroll down to Import/Export demo
  2. open the console
  3. click Reset
  4. click SQL (any of the four SQL choices)
  5. TypeError thrown on null group (argument to parse() in getSQL)

Alternatively:

  1. Click Set rules from SQL
  2. Click Add Rule
  3. Click SQL (any of the four SQL choices)
  4. TypeError thrown on null group (argument to parse() in getSQL)

It appears that validate() returns null when there are rules in error.

image

@mistic100 mistic100 changed the title TypeError: Cannot read property 'condition' of null TypeError when calling getSQL with invalid rules Nov 10, 2017
@mistic100 mistic100 added the bug Identified bug which needs a fix label Nov 11, 2017
@mistic100 mistic100 added this to the 2.4.5 milestone Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identified bug which needs a fix
Projects
None yet
Development

No branches or pull requests

2 participants