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

attrsToString: To avoid some malformed attributes #26

Merged
merged 4 commits into from
Jun 27, 2019
Merged

attrsToString: To avoid some malformed attributes #26

merged 4 commits into from
Jun 27, 2019

Conversation

arkhamvm
Copy link
Contributor

@arkhamvm arkhamvm commented Jun 24, 2019

Error:

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at attrsToString

This errors appears if no attrs setted in custom tag:

const BBcodePresetTemp = BbobPresetHTML5.extend((tags: any) => {
	tags.br = () => ({
		tag: 'br',
		// attrs: {}, // <-- Comment this line for error and add [br] to text
		content: null,
	});

	return tags;
});

The dirty fix. Should be test and warning added.

arkhamvm added 2 commits June 24, 2019 16:29
Error:
```
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at attrsToString
```

This errors appears if no `attrs` setted in custom tag:
```
const BBcodePresetTemp = BbobPresetHTML5.extend((tags: any) => {
	tags.br = () => ({
		tag: 'br',
		// attrs: {}, // <-- Comment this line for error and add [br] to text
		content: null,
	});

	return tags;
});
```

The dirty fix. Should be test and warning added.
@codecov-io
Copy link

codecov-io commented Jun 24, 2019

Codecov Report

Merging #26 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   93.89%   93.92%   +0.02%     
==========================================
  Files          15       15              
  Lines         475      477       +2     
  Branches      101      102       +1     
==========================================
+ Hits          446      448       +2     
  Misses         23       23              
  Partials        6        6
Impacted Files Coverage Δ
packages/bbob-plugin-helper/src/index.js 96% <100%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5291543...4a82a0b. Read the comment docs.

@JiLiZART
Copy link
Owner

Yay! Big thanks to PR!
I think we need some tests to cover this situation :)

@arkhamvm
Copy link
Contributor Author

I think we need some tests to cover this situation :)

Done.

@JiLiZART JiLiZART merged commit 09ff9af into JiLiZART:master Jun 27, 2019
@JiLiZART
Copy link
Owner

Thanks! I release patch version soon.

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 this pull request may close these issues.

3 participants