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

Exception thrown by validator if unopened tag closes #573

Open
1 of 2 tasks
guillermoheras-bjss opened this issue May 12, 2023 · 2 comments
Open
1 of 2 tasks

Exception thrown by validator if unopened tag closes #573

guillermoheras-bjss opened this issue May 12, 2023 · 2 comments
Labels
Pending Pending to be confirmed by user/author for some check/update/implementation

Comments

@guillermoheras-bjss
Copy link

  • [ X ] Are you running the latest version?
  • [ X ] Have you included sample input, output, error, and expected output?
  • [ X ] Have you checked if you are using correct configuration?
  • [ X ] Did you try online tool? (getting the same error when parsing, the validation of the online tool outputs "Output")

Description

A closing tag that hasn't been opened causes an exception to be thrown, instead of returning a validation error (as would be expected)

Code

import { XMLValidator } from "fast-xml-parser";

// This throws an exception
XMLValidator.validate("<Document>some text</Document></badTag>");

Output

Exception thrown:

TypeError: Cannot read properties of undefined (reading 'tagName')
at exports.validate (/home/guillermoheras/lhv/banking-services/apps/portal/node_modules/fast-xml-parser/src/validator.js:108:33)

expected data

a ValidationError object should be returned

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.

@github-actions
Copy link

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

@amitguptagwl amitguptagwl added the Pending Pending to be confirmed by user/author for some check/update/implementation label May 17, 2023
@PCOffline
Copy link

Hey I'm facing the same issue and would love a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending Pending to be confirmed by user/author for some check/update/implementation
Projects
None yet
Development

No branches or pull requests

3 participants