diff --git a/server/modules/computer-use/semantics/helpers/macos/CloudCLISemantics.swift b/server/modules/computer-use/semantics/helpers/macos/CloudCLISemantics.swift index 780c5f0c..8b83f9ee 100644 --- a/server/modules/computer-use/semantics/helpers/macos/CloudCLISemantics.swift +++ b/server/modules/computer-use/semantics/helpers/macos/CloudCLISemantics.swift @@ -74,9 +74,13 @@ func bounds(_ element: AXUIElement) -> [String: Double]? { var point = CGPoint.zero var size = CGSize.zero - guard let positionAxValue = positionValue as? AXValue, - let sizeAxValue = sizeValue as? AXValue, - AXValueGetValue(positionAxValue, .cgPoint, &point), + guard CFGetTypeID(positionValue) == AXValueGetTypeID(), + CFGetTypeID(sizeValue) == AXValueGetTypeID() + else { return nil } + + let positionAxValue = positionValue as! AXValue + let sizeAxValue = sizeValue as! AXValue + guard AXValueGetValue(positionAxValue, .cgPoint, &point), AXValueGetValue(sizeAxValue, .cgSize, &size) else { return nil }