aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/AddressBook/Addressbook.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-30 11:49:27 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-30 11:49:27 -0700
commitbde01d532610543072de3fd9f5d40823e1f1d53f (patch)
tree6e09e402e5422bc5959ec1032a9fb5b83f14d1e8 /csharp/src/AddressBook/Addressbook.cs
parent7909b2edeb19affdf3f96a0b13a8098f28860c3c (diff)
parentd18cc0845606c32e01e044ae5411c7053b1c73ec (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.cs6
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");
}
}