From 7b1db6a102913883d2025ef20392e95996cac317 Mon Sep 17 00:00:00 2001 From: armada Date: Mon, 26 Oct 2026 01:43:32 +0300 Subject: [PATCH] fix: Handle error replies to noray connect command When noray can't connect two peers, e.g. because the host OID is unknown, it replies with a `connect` command whose payload is an error message instead of an address. The handler indexed the split result unconditionally, which crashed. Log the error and skip emitting `on_connect_nat` instead. --- addons/netfox.noray/noray.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/netfox.noray/noray.gd b/addons/netfox.noray/noray.gd index 9caaa8574..e215e0323 100644 --- a/addons/netfox.noray/noray.gd +++ b/addons/netfox.noray/noray.gd @@ -195,6 +195,10 @@ func _handle_commands(command: String, data: String): _logger.debug("Saved PID: %s", [pid]) elif command == "connect": var parts = data.split(":") + # On failure, noray replies with the same command name and an error message + if parts.size() != 2 or not parts[1].is_valid_int(): + _logger.error("Failed to connect over NAT: %s", [data]) + return var host = parts[0] var port = parts[1].to_int() _logger.debug("Received connect command to %s:%s", [host, port])