aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/Collections/MapField.cs
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-29 09:32:55 -0700
committerJan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-29 09:32:55 -0700
commit74810c6ae3219498dd3e856f9cd251588c92a899 (patch)
tree0219cb8b83055e03b8a09b9e24921ab16fb5b6d0 /csharp/src/Google.Protobuf/Collections/MapField.cs
parentedff88886b03055f8dff0c0dad61d9450b59a23e (diff)
parentd82ebe48e127469059c043ff3c7e69605fca5969 (diff)
downloadprotobuf-74810c6ae3219498dd3e856f9cd251588c92a899.tar.gz
protobuf-74810c6ae3219498dd3e856f9cd251588c92a899.tar.bz2
protobuf-74810c6ae3219498dd3e856f9cd251588c92a899.zip
Merge pull request #638 from jskeet/portable
First attempt at using profile 259 for Google.Protobuf.
Diffstat (limited to 'csharp/src/Google.Protobuf/Collections/MapField.cs')
-rw-r--r--csharp/src/Google.Protobuf/Collections/MapField.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs
index 9ca5104d..68f2f1cc 100644
--- a/csharp/src/Google.Protobuf/Collections/MapField.cs
+++ b/csharp/src/Google.Protobuf/Collections/MapField.cs
@@ -35,6 +35,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
+using Google.Protobuf.Compatibility;
namespace Google.Protobuf.Collections
{
@@ -74,7 +75,7 @@ namespace Google.Protobuf.Collections
/// <param name="allowNullValues">Whether null values are permitted in the map or not.</param>
public MapField(bool allowNullValues)
{
- if (allowNullValues && typeof(TValue).IsValueType && Nullable.GetUnderlyingType(typeof(TValue)) == null)
+ if (allowNullValues && typeof(TValue).IsValueType() && Nullable.GetUnderlyingType(typeof(TValue)) == null)
{
throw new ArgumentException("allowNullValues", "Non-nullable value types do not support null values");
}