fix: only run list option check if not null

This commit is contained in:
Sculas 2022-09-07 23:46:46 +02:00 committed by GitHub
parent 85120374d6
commit 4055939c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,7 +158,7 @@ sealed class PatchOption<T>(
} }
) { ) {
init { init {
if (default !in options) { if (default != null && default !in options) {
throw IllegalStateException("Default option must be an allowed option") throw IllegalStateException("Default option must be an allowed option")
} }
} }
@ -227,4 +227,4 @@ sealed class PatchOption<T>(
validator(it?.toFile()) validator(it?.toFile())
} }
) )
} }