1 package net.pterodactylus.sone.utils
3 fun <T> T?.asList() = this?.let(::listOf) ?: emptyList()
4 val Any?.unit get() = Unit
6 fun <T> T?.throwOnNullIf(throwCondition: Boolean, exception: () -> Throwable) =
7 if (this == null && throwCondition) throw exception() else this
9 fun <T> T?.onNull(block: () -> Unit) = this.also {