aboutsummaryrefslogtreecommitdiff
path: root/csharp/ProtocolBuffers/GeneratedMessage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/ProtocolBuffers/GeneratedMessage.cs')
-rw-r--r--csharp/ProtocolBuffers/GeneratedMessage.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/csharp/ProtocolBuffers/GeneratedMessage.cs b/csharp/ProtocolBuffers/GeneratedMessage.cs
index 47722d0b..7801d521 100644
--- a/csharp/ProtocolBuffers/GeneratedMessage.cs
+++ b/csharp/ProtocolBuffers/GeneratedMessage.cs
@@ -92,7 +92,7 @@ namespace Google.ProtocolBuffers {
}
}
} else {
- if (!((IMessage) this[field]).IsInitialized) {
+ if (HasField(field) && !((IMessage) this[field]).IsInitialized) {
return false;
}
}