lateinit変数が初期化されているかどうかを確認する方法はあるのでしょうか。例えば:
class Foo() {
private lateinit var myFile: File
fun bar(path: String?) {
path?.let { myFile = File(it) }
}
fun bar2() {
myFile.whateverMethod()
// May crash since I don't know whether myFile has been initialized
}
}
allSeriesのVAR seriesDir?.listFiles()?.map { it.name }?.toTypedArray()非常に「きれい」ではありません、
if (seriesDir != null) { allSeries = seriesDir.listFiles().map { it.name }.toTypedArray() }

File?)、代わりにnullかどうかを確認することでしょうか?