Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 7b4e14e

Browse files
authored
Return zero for message Size when body is null (#657)
Fixes #648
1 parent b70ddf6 commit 7b4e14e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.Azure.ServiceBus/Message.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public TimeSpan TimeToLive
268268
/// <summary>
269269
/// Gets the total size of the message body in bytes.
270270
/// </summary>
271-
public long Size => Body.Length;
271+
public long Size => this.Body != null ? this.Body.Length : 0;
272272

273273
/// <summary>
274274
/// Gets the "user properties" bag, which can be used for custom message metadata.

0 commit comments

Comments
 (0)