Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba9ca1ae authored by Sal Savage's avatar Sal Savage
Browse files

Fix error checking logic -- "if it doesn't have a value"

Tag: #refactor
Bug: 231284685
Test: atest BluetoothInstrumentationTests
Test: adb logcat | grep -e "class od device" -e "COD"
Merged-In: I899300b90103259613afa077276f2fce10a39682
Change-Id: I899300b90103259613afa077276f2fce10a39682
parent 33ba67b5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2228,13 +2228,13 @@ void btif_dm_get_local_class_of_device(DEV_CLASS device_class) {
  // Error check the inputs. Use the default if problems are found
  if (local_device_class.size() != 3) {
    LOG_ERROR("COD malformed, must have unsigned 3 integers.");
  } else if (local_device_class[0].has_value()
  } else if (!local_device_class[0].has_value()
      || local_device_class[0].value() > 0xFF) {
    LOG_ERROR("COD malformed, first value is missing or too large.");
  } else if (local_device_class[1].has_value()
  } else if (!local_device_class[1].has_value()
      || local_device_class[1].value() > 0xFF) {
    LOG_ERROR("COD malformed, second value is missing or too large.");
  } else if (local_device_class[2].has_value()
  } else if (!local_device_class[2].has_value()
      || local_device_class[2].value() > 0xFF) {
    LOG_ERROR("COD malformed, third value is missing or too large.");
  } else {