Skip to content

Commit

Permalink
Fix compilation errors by using unsafe nullables
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt committed Apr 3, 2022
1 parent c510243 commit 9f94450
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions core/src/appleMain/kotlin/Profile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public actual data class DiscoveredCharacteristic internal constructor(
.map { it as PlatformDescriptor }
.map(::DiscoveredDescriptor)

override val serviceUuid: Uuid = characteristic.service.UUID.toUuid()
override val serviceUuid: Uuid = characteristic.service!!.UUID.toUuid()
override val characteristicUuid: Uuid = characteristic.UUID.toUuid()

public actual val properties: Properties = Properties(characteristic.properties.toInt())
Expand All @@ -46,12 +46,12 @@ public actual data class DiscoveredDescriptor internal constructor(
internal actual val descriptor: PlatformDescriptor,
) : Descriptor {

override val serviceUuid: Uuid = descriptor.characteristic.service.UUID.toUuid()
override val characteristicUuid: Uuid = descriptor.characteristic.UUID.toUuid()
override val serviceUuid: Uuid = descriptor.characteristic!!.service!!.UUID.toUuid()
override val characteristicUuid: Uuid = descriptor.characteristic!!.UUID.toUuid()
override val descriptorUuid: Uuid = descriptor.UUID.toUuid()
}

internal fun PlatformCharacteristic.toLazyCharacteristic() = LazyCharacteristic(
serviceUuid = service.UUID.toUuid(),
serviceUuid = service!!.UUID.toUuid(),
characteristicUuid = UUID.toUuid(),
)
4 changes: 2 additions & 2 deletions core/src/appleMain/kotlin/logs/LogMessage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ internal fun LogMessage.detail(service: CBService) {
}

internal fun LogMessage.detail(characteristic: CBCharacteristic) {
detail(characteristic.service)
detail(characteristic.service!!)
detail("characteristic", characteristic.UUID.UUIDString)
}

internal fun LogMessage.detail(descriptor: CBDescriptor) {
detail(descriptor.characteristic)
detail(descriptor.characteristic!!)
detail("descriptor", descriptor.UUID.UUIDString)
}

0 comments on commit 9f94450

Please sign in to comment.