Skip to content

Commit

Permalink
restoring null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
biii-tech authored Apr 11, 2022
1 parent 37f8537 commit 2914abe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.signify.hue.flutterreactiveble.converters

import android.util.SparseArray

fun extractManufacturerData(manufacturerData: SparseArray<ByteArray>): ByteArray {
fun extractManufacturerData(manufacturerData: SparseArray<ByteArray>?): ByteArray {
val rawData = mutableListOf<Byte>()

if (manufacturerData.size() > 0) {
if (manufacturerData != null && manufacturerData.size() > 0) {
val companyId = manufacturerData.keyAt(0)
rawData.add((companyId.toByte()))
rawData.add(((companyId.shr(Byte.SIZE_BITS)).toByte()))
Expand Down

0 comments on commit 2914abe

Please sign in to comment.