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

Handle undefined results in the match array #444

Merged
merged 1 commit into from
Feb 7, 2018

Conversation

stefanbuck
Copy link
Member

Fix for #443. This was caused by combination, where the composer plugin returns undefined if the json key is php and a not solid forEach loop in the octolinker core.

screen shot 2018-02-07 at 22 54 31

@@ -18,7 +18,12 @@ function initialize(self) {
}

function insertDataAttr(matches) {
matches.forEach(({ data, link }) => {
matches.forEach(item => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another solutions would be to strip out all undefindes in the first place, although this would require an additional loop over matches. Anyway, at the end it really doesn't matter IMO

Copy link
Member

@josephfrazier josephfrazier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution seems great for now!

@josephfrazier josephfrazier merged commit fd0b159 into OctoLinker:master Feb 7, 2018
@stefanbuck stefanbuck deleted the fix-443 branch February 8, 2018 05:20
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.

2 participants