Skip to content

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

Closed
@TomasMikula

Description

@TomasMikula

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions