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

NullPointerException when source file does not exist (e.g. in mdoc) #118

Closed
TomasMikula opened this issue Nov 17, 2021 · 1 comment
Closed

Comments

@TomasMikula
Copy link

Hi,

when trying to use sourcecode in an mdoc snippet, NullPointerException is thrown.

Mdoc input:

```scala mdoc
implicitly[sourcecode.File]
```

Error:

java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toAbsolutePath()" because the return value of "scala.quoted.Quotes$reflectModule$SourceFileMethods.jpath(Object)" is null
	at sourcecode.Macros$.fileImpl(Macros.scala:150)

Would it be possible to return something like File("<none>") instead?

@lihaoyi
Copy link
Member

lihaoyi commented Apr 15, 2024

Fixed by #153

@lihaoyi lihaoyi closed this as completed Apr 15, 2024
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

No branches or pull requests

2 participants