From df344baa069d2ee2228243cb4a10731d1847e3c8 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Sat, 22 Mar 2025 14:43:52 +0900 Subject: [PATCH] [bugfix] Controller: Fix response handling in setOscIpAddress method. --- src-python/controller.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src-python/controller.py b/src-python/controller.py index 98b84844..df6267ff 100644 --- a/src-python/controller.py +++ b/src-python/controller.py @@ -1086,7 +1086,7 @@ class Controller: @staticmethod def setOscIpAddress(data, *args, **kwargs) -> dict: if isValidIpAddress(data) is False: - return { + response = { "status":400, "result":{ "message":"Invalid IP address", @@ -1097,16 +1097,17 @@ class Controller: try: model.setOscIpAddress(data) config.OSC_IP_ADDRESS = data - return {"status":200, "result":config.OSC_IP_ADDRESS} + response = {"status":200, "result":config.OSC_IP_ADDRESS} except Exception: model.setOscIpAddress(config.OSC_IP_ADDRESS) - return { + response = { "status":400, "result":{ "message":"Cannot set IP address", "data": config.OSC_IP_ADDRESS } } + return response @staticmethod def getOscPort(*args, **kwargs) -> dict: