Skip to content

Commit b6fb58e

Browse files
committed
android: don't crash if self MAC is not available
1 parent 993ba1b commit b6fb58e

File tree

1 file changed

+3
-1
lines changed
  • android/app/src/main/java/me/kavishdevar/librepods/utils

1 file changed

+3
-1
lines changed

android/app/src/main/java/me/kavishdevar/librepods/utils/AACPManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,9 @@ class AACPManager {
764764

765765
fun sendMediaInformationNewDevice(selfMacAddress: String, targetMacAddress: String): Boolean {
766766
if (selfMacAddress.length != 17 || !selfMacAddress.matches(Regex("([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}")) || targetMacAddress.length != 17 || !targetMacAddress.matches(Regex("([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}"))) {
767-
throw IllegalArgumentException("MAC address must be 6 bytes")
767+
// throw IllegalArgumentException("MAC address must be 6 bytes")
768+
Log.w(TAG, "Invalid MAC address format, got: selfMacAddress=$selfMacAddress, targetMacAddress=$targetMacAddress")
769+
return false
768770
}
769771
Log.d(TAG, "SELFMAC: ${selfMacAddress}, TARGETMAC: $targetMacAddress")
770772
Log.d(TAG, "Sending Media Information packet to $targetMacAddress")

0 commit comments

Comments
 (0)