diff --git a/src/NetworkTables/NT4Client.swift b/src/NetworkTables/NT4Client.swift index 4fdc3ae..b8aba11 100644 --- a/src/NetworkTables/NT4Client.swift +++ b/src/NetworkTables/NT4Client.swift @@ -63,9 +63,9 @@ class NT4Client: WebSocketDelegate { onDisconnect?(reason, code) case .text(let string): if let data = string.data(using: .utf8) { - if let msg = try? JSONSerialization.jsonObject(with: args.Data, options: []) as? [[String: Any]] { + if let msg = try? JSONSerialization.jsonObject(with: data, options: []) as? [[String: Any]] { if msg == nil { - print("[NT4] Failed to decode JSON message: \(message)") + print("[NT4] Failed to decode JSON message: \(string)") return } // Iterate through the messages @@ -162,4 +162,4 @@ class NT4Client: WebSocketDelegate { return NT4Client.getClientTimeUS() + serverTimeOffset_us! } -} \ No newline at end of file +}