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

override val scalaCheckInitialSeed = ... leads to NullPointerException #563

Closed
FrancescoSerra opened this issue Jul 22, 2022 · 1 comment · Fixed by #564
Closed

override val scalaCheckInitialSeed = ... leads to NullPointerException #563

FrancescoSerra opened this issue Jul 22, 2022 · 1 comment · Fixed by #564

Comments

@FrancescoSerra
Copy link

Hi, as per the output in this issue, I've been overriding the scalaCheckInitialSeed, but when running the test I got:

==> X org.http4s.PathSuite.initializationError  0.002s java.lang.NullPointerException: Cannot invoke "String.length()" because "s$1" is null
    at org.scalacheck.rng.Seed$.$anonfun$fromBase64$1(Seed.scala:188)
    at scala.util.Try$.apply(Try.scala:210)
    at org.scalacheck.rng.Seed$.fromBase64(Seed.scala:187)
    at munit.ScalaCheckEffectSuite.$anonfun$initialSeed$1(ScalaCheckEffectSuite.scala:42)
    at scala.Option.getOrElse(Option.scala:201)
    at munit.ScalaCheckEffectSuite.$init$(ScalaCheckEffectSuite.scala:42)

However, override **def** scalaCheckInitialSeed = worked just fine.

@armanbilge
Copy link
Contributor

lazy val can probably work here too. But honestly a def seems fine for a String constant.

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 a pull request may close this issue.

2 participants