From f221aae3954f87dc61c232e34ac9c6de7eccd666 Mon Sep 17 00:00:00 2001 From: Felipe Martinez Date: Sat, 23 Mar 2024 13:59:34 +0100 Subject: [PATCH] Throw exception --- .../pinepartner/scripting/api/adapters/WatchAdapter.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/net/pipe01/pinepartner/scripting/api/adapters/WatchAdapter.kt b/app/src/main/java/net/pipe01/pinepartner/scripting/api/adapters/WatchAdapter.kt index 13dc5e8..ff1617d 100644 --- a/app/src/main/java/net/pipe01/pinepartner/scripting/api/adapters/WatchAdapter.kt +++ b/app/src/main/java/net/pipe01/pinepartner/scripting/api/adapters/WatchAdapter.kt @@ -44,10 +44,7 @@ class WatchAdapter : ApiScriptableObject(WatchAdapter::class) { field.isAccessible = true field.get(time) as Double } - else -> { - Context.throwAsScriptRuntimeEx(IllegalArgumentException("Invalid time")) - 0.0 - } + else -> throw Context.throwAsScriptRuntimeEx(IllegalArgumentException("Invalid time")) } val localTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timeMillis.toLong()), ZoneId.systemDefault())