diff options
author | 2015-07-30 11:49:27 -0700 | |
---|---|---|
committer | 2015-07-30 11:49:27 -0700 | |
commit | bde01d532610543072de3fd9f5d40823e1f1d53f (patch) | |
tree | 6e09e402e5422bc5959ec1032a9fb5b83f14d1e8 /csharp/src/AddressBook/Addressbook.cs | |
parent | 7909b2edeb19affdf3f96a0b13a8098f28860c3c (diff) | |
parent | d18cc0845606c32e01e044ae5411c7053b1c73ec (diff) |
Merge pull request #660 from jskeet/throw-on-null
Throw on null for string/bytes single fields
Diffstat (limited to 'csharp/src/AddressBook/Addressbook.cs')
-rw-r--r-- | csharp/src/AddressBook/Addressbook.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 92f983e7..25752e20 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -76,7 +76,7 @@ namespace Google.Protobuf.Examples.AddressBook { public string Name { get { return name_; } set { - name_ = value ?? ""; + name_ = pb::Preconditions.CheckNotNull(value, "value"); } } @@ -94,7 +94,7 @@ namespace Google.Protobuf.Examples.AddressBook { public string Email { get { return email_; } set { - email_ = value ?? ""; + email_ = pb::Preconditions.CheckNotNull(value, "value"); } } @@ -257,7 +257,7 @@ namespace Google.Protobuf.Examples.AddressBook { public string Number { get { return number_; } set { - number_ = value ?? ""; + number_ = pb::Preconditions.CheckNotNull(value, "value"); } } |