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

Does not bail out when capture group is empty #540

Merged
merged 2 commits into from
Jan 22, 2019

Conversation

stefanbuck
Copy link
Member

Bugfix for #539.

OctoLinker stopped working, because the key decompress-response was defined with a boolean value instead of a string.

	"browser": {
		"decompress-response": false,
		"electron": false
	},

This was causing the following runtime error
TypeError: Cannot read property 'length' of undefined.

if (matchValue.length !== matchValue.replace(/['|"]/g, '').length) {

I fixed this issue in two places. First, the npm plugin returns early if the given value is not from type string. Second, if a capture group is empty (which should be never the case), the current node will be returned without adding a link.

@stefanbuck stefanbuck merged commit 883ed30 into OctoLinker:master Jan 22, 2019
@stefanbuck stefanbuck deleted the fix-539 branch January 22, 2019 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant