File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
MCPForUnity/UnityMcpServer~/src/tools Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,11 @@ def _to_vec3(parts):
119119 try :
120120 component_properties = json .loads (component_properties )
121121 ctx .info ("manage_gameobject: coerced component_properties from JSON string to dict" )
122- except Exception as e :
123- ctx .warn (f"manage_gameobject: failed to parse component_properties JSON string: { e } " )
122+ except json .JSONDecodeError as e :
123+ return {"success" : False , "message" : f"Invalid JSON in component_properties: { e } " }
124+ # Ensure final type is a dict (object) if provided
125+ if component_properties is not None and not isinstance (component_properties , dict ):
126+ return {"success" : False , "message" : "component_properties must be a JSON object (dict)." }
124127 try :
125128 # Map tag to search_term when search_method is by_tag for backward compatibility
126129 if action == "find" and search_method == "by_tag" and tag is not None and search_term is None :
You can’t perform that action at this time.
0 commit comments