Skip to content

NullPointerError on creating Option[Int] from null Java Integer #355

@KieranPringle

Description

@KieranPringle
def getOptionalIntegerFromConfig: Option[Int] = {
    Option(methodFromJavaClassThatMayReturnANullInteger)
}
Caused by: java.lang.NullPointerException
    at scala.Predef$.Integer2int(Predef.scala:357)
    at com.package.Class$.getOptionalIntegerFromConfig(Class.scala:109)

I couldn't find anything in the bug tracker here on GitHub so I apologise if this is a known issue or not an issue or has been reported already

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