Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Cannot read property 'toLowerCase' of undefined Bugfix #1806

Closed

Conversation

tikudev
Copy link

@tikudev tikudev commented Oct 24, 2019

The function areSimilar examines whether two nodes are similar by checking their tag names. Textnodes are already excluded because they have no tagNames. This commit also excludes CommentNodes because they also have no tagNames, which leads to a Javascript Error, when HTMLCommentNodes are currently parsed by the CKEditor.

The function areSimilar examines whether two nodes are similar by checking their tag names. Textnodes are already excluded because they have no tagNames. This commit also excludes CommentNodes because they also have no tagNames, which leads to a Javascript Error, when HTMLCommentNodes are currently parsed by the CKEditor.
@oleq
Copy link
Member

oleq commented Oct 29, 2019

Hi, @tiku91!

Thanks for your contribution. Could you please tell us more about your problem? A test or a valid reproduction path (like editor data you used, your plugins and customization) would certainly help us understand it better.

@Reinmar
Copy link
Member

Reinmar commented Nov 15, 2019

Curious whether it doesn't fix ckeditor/ckeditor5#5734.

For now, I'm marking as R-.

@tikudev
Copy link
Author

tikudev commented Jan 28, 2020

@oleq @Reinmar
Hello and thank your for your patience.
You can find a more detailed description of the error and a valid reproduction path in ckeditor/ckeditor5#5734
As I have stated in my commit message, the error in the code is pretty straight forward, there is a node.tagName.toLowerCase() call, in which it is not checked whether the node has a tagName. In comment nodes those tagNames are undefined and therefore the error: "cannot read property toLowerCase() of undefined".
I do not feel comfortable to disclose personal information in order to sign the CLA. If that means you can not accept the PR, then I hope that you can fix the Problem by writing the one line of code yourself ;) (Check whether the node is a comment-node before calling toLowerCase)

@tomalec
Copy link
Contributor

tomalec commented Jun 8, 2020

@tiku91 thank you for your support.
Given, lack of CLA from you, I created a new PR, and I'm closing this one in favor of ckeditor/ckeditor5#7403.

@tomalec tomalec closed this Jun 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants