Skip to content

Fix a crash when using --no-generate-docs #2137

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

Merged
merged 2 commits into from
Jan 27, 2020

Conversation

jdkoren
Copy link
Contributor

@jdkoren jdkoren commented Jan 21, 2020

Fixes a crash when accessing documentationAsHtml directly. Most usages first check hasDocumentation, but nothing enforces this. Notably, EmptyGenerator accesses this property without checking first (you can reproduce the crash by passing --no-generate-docs).

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Jan 21, 2020
@jdkoren jdkoren requested a review from jcollins-g January 21, 2020 22:03
Copy link
Contributor

@jcollins-g jcollins-g left a comment

Choose a reason for hiding this comment

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

I think a better solution would be to move this to _parseDocumentation and return ([], false) as the value of the tuple. The renderers should be able to handle that as input, and there's less special casing that way.

@jdkoren
Copy link
Contributor Author

jdkoren commented Jan 22, 2020

I think a better solution would be to move this to _parseDocumentation and return ([], false) as the value of the tuple. The renderers should be able to handle that as input, and there's less special casing that way.

This works, too. In that case I added a check in the renderer so it skips creating further objects.

@jdkoren jdkoren requested a review from jcollins-g January 22, 2020 20:57
@jdkoren jdkoren merged commit daf5b6f into dart-lang:master Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants