diff --git a/libsignal-service/src/cipher.rs b/libsignal-service/src/cipher.rs index 34477875c..d50e606d6 100644 --- a/libsignal-service/src/cipher.rs +++ b/libsignal-service/src/cipher.rs @@ -47,20 +47,24 @@ impl fmt::Debug for ServiceCipher { } fn debug_envelope(envelope: &Envelope) -> String { - format!( - "Envelope {{ \ + if envelope.content.is_none() { + format!("Envelope {{ empty }}") + } else { + format!( + "Envelope {{ \ source_address: {:?}, \ source_device: {:?}, \ server_guid: {:?}, \ timestamp: {:?}, \ content: {} bytes, \ }}", - envelope.source_address(), - envelope.source_device(), - envelope.server_guid(), - envelope.timestamp(), - envelope.content().len(), - ) + envelope.source_address(), + envelope.source_device(), + envelope.server_guid(), + envelope.timestamp(), + envelope.content().len(), + ) + } } impl ServiceCipher