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 empty files and truncated YAML front matter #17527

Merged
merged 1 commit into from
May 17, 2023

Conversation

mbovel
Copy link
Member

@mbovel mbovel commented May 17, 2023

Scaladoc crashes when a static file is empty:

[error] Caused by: java.util.NoSuchElementException: head of empty list
[error] 	at scala.collection.immutable.Nil$.head(List.scala:662)
[error] 	at scala.collection.immutable.Nil$.head(List.scala:661)
[error] 	at dotty.tools.scaladoc.site.common$package$.loadTemplateFile(common.scala:66)
[error] 	at dotty.tools.scaladoc.site.StaticSiteLoader.loadRecursively(StaticSiteLoader.scala:191)
[error] 	at dotty.tools.scaladoc.site.StaticSiteLoader.loadRecursively$$anonfun$1(StaticSiteLoader.scala:188)

See sbt/sbt#7256 for more context.

This PR solves this issue, and also handles unended YAML front matter.

@mbovel mbovel requested a review from Florian3k May 17, 2023 11:56
@mbovel mbovel enabled auto-merge May 17, 2023 12:07
@mbovel mbovel merged commit 9c2902d into scala:main May 17, 2023
@mbovel mbovel deleted the mb/scaladoc-empty-file branch May 17, 2023 21:14
@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 2, 2023
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