File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import kotlinx.cinterop.*
1010import kotlinx.datetime.internal.*
1111import platform.Foundation.*
1212
13- internal actual val systemTzdb: TimeZoneDatabase = TzdbOnFilesystem (Path .fromString(defaultTzdbPath()))
13+ internal actual val systemTzdb: TimeZoneDatabase get() = tzdb.getOrThrow()
14+
15+ private val tzdb = runCatching { TzdbOnFilesystem (Path .fromString(defaultTzdbPath())) }
1416
1517internal expect fun defaultTzdbPath (): String
1618
Original file line number Diff line number Diff line change 55
66package kotlinx.datetime.internal
77
8- internal actual val systemTzdb: TimeZoneDatabase = TzdbOnFilesystem ()
8+ internal actual val systemTzdb: TimeZoneDatabase get() = tzdb.getOrThrow()
9+
10+ private val tzdb = runCatching { TzdbOnFilesystem () }
911
1012internal actual fun currentSystemDefaultZone (): Pair <String , TimeZoneRules ?> {
1113 val zoneId = pathToSystemDefault()?.second?.toString()
Original file line number Diff line number Diff line change 55
66package kotlinx.datetime.internal
77
8- internal actual val systemTzdb: TimeZoneDatabase get() = tzdbInRegistry
8+ internal actual val systemTzdb: TimeZoneDatabase get() = tzdbInRegistry.getOrThrow()
99
10- internal actual fun currentSystemDefaultZone (): Pair <String , TimeZoneRules ?> = tzdbInRegistry.currentSystemDefault()
10+ internal actual fun currentSystemDefaultZone (): Pair <String , TimeZoneRules ?> =
11+ tzdbInRegistry.getOrThrow().currentSystemDefault()
1112
12- private val tzdbInRegistry = TzdbInRegistry ()
13+ private val tzdbInRegistry = runCatching { TzdbInRegistry () }
You can’t perform that action at this time.
0 commit comments