Skip to content

Commit b75da55

Browse files
committed
Updated JSBluetoothDevice
1 parent 2f0eae8 commit b75da55

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/JavaScriptKit/JS Types/JSBluetoothDevice.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ public final class JSBluetoothDevice: JSType {
2222

2323
public lazy var id: String = self.jsObject.get("id").string!
2424

25-
public lazy var name: String = self.jsObject.name.string!
26-
25+
public lazy var name: String? = self.jsObject.name.string
26+
}
27+
28+
// MARK: - CustomStringConvertible
29+
30+
extension JSBluetoothDevice: CustomStringConvertible {
2731

32+
public var description: String {
33+
return "JSBluetoothDevice(id: \(id), name: \(name ?? "nil"))"
34+
}
2835
}
2936

3037
// MARK: - Identifiable

0 commit comments

Comments
 (0)