From 472de8f6802715191395f64795f49da71623004b Mon Sep 17 00:00:00 2001 From: Fingercomp Date: Thu, 27 Aug 2026 23:17:26 +0300 Subject: [PATCH] Map () to nil when converting callback results Whenever a callback wants to return a `nil` value, it has to pass either `null` or `None` to the `result` function (in fact, previously all the code used `null` exclusively). But I guess the vibeport really wanted to follow Scala conventions because it replaced these nulls with `()` in a lot of places, which the Registry did not handle explicitly, falling back to stringifying it during the conversion. As a result, a bunch of methods returned `"()", errorMessage` where before it would've been `nil, errorMessage`. This commit adds an explicit case for `()` in the conversion routine so that `()` gets mapped to `nil`, fixing all of these methods. --- src/main/scala/li/cil/oc/server/driver/Registry.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/li/cil/oc/server/driver/Registry.scala b/src/main/scala/li/cil/oc/server/driver/Registry.scala index 9019640b66..82d4b8de83 100644 --- a/src/main/scala/li/cil/oc/server/driver/Registry.scala +++ b/src/main/scala/li/cil/oc/server/driver/Registry.scala @@ -157,7 +157,7 @@ private[oc] object Registry extends api.detail.DriverAPI { } else { valueRef match { - case null | None => null + case null | () | None => null case arg: java.lang.Boolean => arg case arg: java.lang.Byte => arg case arg: java.lang.Character => arg