mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(service): Add error handling for invalid StoreForward++ packets (#4319)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
28cf2b1e98
commit
4d7af80389
1 changed files with 8 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ import co.touchlab.kermit.Logger
|
|||
import com.geeksville.mesh.BuildConfig
|
||||
import com.geeksville.mesh.concurrent.handledLaunch
|
||||
import com.geeksville.mesh.repository.radio.InterfaceId
|
||||
import com.google.protobuf.InvalidProtocolBufferException
|
||||
import com.meshtastic.core.strings.getString
|
||||
import dagger.Lazy
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
|
@ -198,7 +199,13 @@ constructor(
|
|||
|
||||
@Suppress("LongMethod")
|
||||
private fun handleStoreForwardPlusPlus(packet: MeshPacket) {
|
||||
val sfpp = MeshProtos.StoreForwardPlusPlus.parseFrom(packet.decoded.payload)
|
||||
val sfpp =
|
||||
try {
|
||||
MeshProtos.StoreForwardPlusPlus.parseFrom(packet.decoded.payload)
|
||||
} catch (e: InvalidProtocolBufferException) {
|
||||
Logger.e(e) { "Failed to parse StoreForwardPlusPlus packet" }
|
||||
return
|
||||
}
|
||||
Logger.d { "Received StoreForwardPlusPlus packet: $sfpp" }
|
||||
|
||||
when (sfpp.sfppMessageType) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue