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

Calling marked() with undefined results in unclear error #442

Closed
doekman opened this issue Jul 3, 2014 · 2 comments · Fixed by #682
Closed

Calling marked() with undefined results in unclear error #442

doekman opened this issue Jul 3, 2014 · 2 comments · Fixed by #682

Comments

@doekman
Copy link

doekman commented Jul 3, 2014

When calling marked(undefined), you get the error TypeError: Cannot read property 'replace' of undefined Please report this to https://github.com/chjj/marked..

This error message is not helpful. Either return an empty string, or raise some kind of ArgumentException. This will help de caller identify the problem quicker.

@fastf0rward
Copy link

+1

@kuba-kubula
Copy link

Easies way is to not pass undefined to marked, e.g.: marked(myString || '') -- solved.

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 a pull request may close this issue.

3 participants